mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
Fix errors when no featured image is set
This commit is contained in:
@@ -59,7 +59,7 @@ class Display_Featured_Image_Genesis_Common {
|
||||
// set a content variable so backstretch doesn't show if full size image exists in post.
|
||||
$item->content = false;
|
||||
// declare this last so that $item->backstretch is set.
|
||||
if ( ! is_admin() && is_singular() ) {
|
||||
if ( ! is_admin() && is_singular() && ! empty( $item->backstretch[0] ) ) {
|
||||
$post_content = get_post_field( 'post_content' );
|
||||
$item->content = strpos( $post_content, 'src="' . $item->backstretch[0] );
|
||||
}
|
||||
@@ -350,7 +350,8 @@ class Display_Featured_Image_Genesis_Common {
|
||||
FROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta
|
||||
WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value IN ( %s, %s ) AND wposts.post_type = 'attachment'
|
||||
",
|
||||
$url_stripped, $attachment_url
|
||||
$url_stripped,
|
||||
$attachment_url
|
||||
);
|
||||
|
||||
$result = $wpdb->get_col( $query_sql );
|
||||
|
||||
Reference in New Issue
Block a user