mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-11 18:46:03 +09:00
add tax image if there is no featured image
needs checking to see what happens if there is no tax image, but there is a fallback image
This commit is contained in:
@@ -68,8 +68,20 @@ class Display_Featured_Image_Genesis_Common {
|
||||
$image_id = self::get_image_id( $term_meta['dfig_image'] );
|
||||
}
|
||||
// any singular post/page/CPT with either a post_thumbnail larger than medium size OR there is no $item->fallback
|
||||
elseif ( is_singular() && ( $width > $item->medium || empty( $item->fallback ) ) && ! in_array( get_post_type(), self::use_fallback_image() ) ) {
|
||||
$image_id = get_post_thumbnail_id( $post->ID );
|
||||
elseif ( is_singular() ) {
|
||||
if ( ( $width > $item->medium /*|| empty( $item->fallback )*/ ) && ! in_array( get_post_type(), self::use_fallback_image() ) ) {
|
||||
$image_id = get_post_thumbnail_id( $post->ID );
|
||||
}
|
||||
elseif ( ! has_post_thumbnail() ) {
|
||||
$terms = get_taxonomies();
|
||||
$args = array( 'fields' => 'ids', 'orderby' => 'term_group', 'order' => 'DESC' );
|
||||
$terms = wp_get_object_terms( get_the_ID(), $terms, $args );
|
||||
|
||||
foreach ( $terms as $t_id ) {
|
||||
$term_meta = get_option( "taxonomy_$t_id" );
|
||||
$image_id = Display_Featured_Image_Genesis_Common::get_image_id( $term_meta['dfig_image'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//now actually set the backstretch image source, which includes some metadata
|
||||
|
||||
Reference in New Issue
Block a user