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:
Robin Cornett
2014-12-31 10:02:02 -05:00
parent 42f98531a8
commit c5acb81938
@@ -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