Site logo

Archived topic

Featured Image caption appearing on homepage/ sidebar images

7 replies · Started by victor on November 14, 2022

Viewing posts 1–8 of 8

Hello,

How can I disable the featured image caption from appearing there? I want it to appear on posts only. I don't want the caption to appear area like this 👉 https://ibb.co/0tGPCcZ

Hi, click on any post on twendesasa.com and peep on the side bar widget..you will see the copyright caption appearing too.How can I fix this?

This is the code on the snippet.

add_action( 'post_thumbnail_html', 'db_auto_single_featured_caption', 10 );
function db_auto_single_featured_caption( $html ) {
$caption = get_the_post_thumbnail_caption();
if ( is_single() && !empty($caption) ){
$html .= '

'. $caption . '

';
}
return $html;
}

Hi there,

simplest fix would be to hide it with some CSS:


aside .wp-show-posts-image .wp-caption {
    display: none;
}

Thank you.

You're welcome

tried adding the css to stavica.com..seems like the captions are still appealing on the homepage. any fix?
Update: Figured it out.

Glad to hear that!

This archived topic is closed to new replies.