Site logo

Archived topic

Update 1.9.1 to 1.10.0 is kicking my featured images

3 replies · Started by Bernd on June 12, 2020

Viewing posts 1–4 of 4

Hi there,

i have (only on one website) a small problem updating to the latest version of GP.

After the update my featured images have disappeared.

Only modifications i think:

I use a small snippet to show credits

add_action( 'post_thumbnail_html', 'tu_custom_byline', 10 );
function tu_custom_byline() {
global $post;
$rightsby = get_post_meta( $post->ID, 'copyright_photo', true );
	echo '<div class="wp-caption thumb-caption">'.$rightsby .'</div>';
}

Many thanks for your efforts!

P.S. GP and GB are simply fantastic. Stay tuned! :)

Hi there,

That code never should have been showing featured images, as the actual HTML featured image variable isn't there.

Try this:

add_action( 'post_thumbnail_html', 'tu_custom_byline', 10 );
function tu_custom_byline( $html ) {
    global $post;
    $rightsby = get_post_meta( $post->ID, 'copyright_photo', true );
    return $html . '<div class="wp-caption thumb-caption">'.$rightsby .'</div>';
}

Hello, Tom,

thanks for your answer. It solved my problem.

very funny that the code has worked so far :)

Glad I could help :)

This archived topic is closed to new replies.