Site icon Chandu 4ever

How to Hide Featured Image of Single Posts in WordPress

How to Hide Featured Image of Single Posts in WordPress

So many peoples try so many CSS codes, I think. For hide featured image of single posts in wordpress. This is the best for you. This trick will work in any wordpress them to hide featured image.

Add this to your functions.php (prefer child-theme), and that is it. It works on any theme, and you don’t need to touch the ugly HTML templates.

function wordpress_hide_feature_image( $html, $post_id, $post_image_id ) {
  return is_single() ? '' : $html;
}
// add the filter
add_filter( 'post_thumbnail_html', 'wordpress_hide_feature_image', 10, 3);
Exit mobile version