feat: page banners use the page's Featured Image when set
- Theme design pages (About, Contact, FAQ, blog list) use the page's Featured Image (Posts page for the blog) and fall back to the design photo; no teal tint over a custom image - Plugin hero (homepage [viator_hero], [viator_listing] pages) prefers the hosting page's Featured Image over the Settings hero image - Theme 1.0.12, plugin 1.9.4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,16 @@ function hoho_asset( $path ) {
|
||||
return get_stylesheet_directory_uri() . '/assets/' . ltrim( $path, '/' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Banner image for a design page: the page's Featured Image when one is set
|
||||
* (for the blog list, the Posts page's), otherwise the design's own photo.
|
||||
*/
|
||||
function hoho_banner_url( $fallback ) {
|
||||
$page_id = ( is_home() && get_option( 'page_for_posts' ) ) ? (int) get_option( 'page_for_posts' ) : get_queried_object_id();
|
||||
$url = $page_id ? get_the_post_thumbnail_url( $page_id, 'full' ) : '';
|
||||
return $url ? $url : hoho_asset( 'img/' . $fallback . '.webp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Social profile links (footer + contact page). Override with the
|
||||
* `hoho_socials` filter.
|
||||
|
||||
Reference in New Issue
Block a user