How to Hide Featured Image of Single Posts in WordPress

Advertisement

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.

Advertisement

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);
https://chandu4ever.com/html-and-css/on-page-css-class-02/
https://chandu4ever.com/html-and-css/off-page-css-class-03/
https://chandu4ever.com/plugins/instagram-feed-v3-8-5-wordpress-instagram-gallery/

Advertisement

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top