- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to remove featured images from posts single pages
June 29, 2015
This tutorial shows how to remove featured images from posts single pages in WordPress.
WordPress. How to remove featured images from posts single pages
By default, featured images are displayed at the top of single post pages:
In order to hide featured images on single post pages, you need to modify the post-thumb.php file. To make such change, please follow the steps listed below:
-
Download and open up the wordpress/wp-content/themes/themeXXXXX/includes/post-formats/post-thumb.php file and locate the line 25 (approximately). There you’ll see the following PHP code:
echo '<figure class="featured-thumbnail thumbnail '.$figure_class.'" >'.$post_image_before.'<img '.$image.' alt="'.get_the_title().'" >'.$post_image_after.'</figure>';
This code echoes (outputs) featured images onto single post pages.
-
Wrap the code mentioned above in a if(!is_single()) condition. You should get the following result:
if(!is_single()) { echo '<figure class="featured-thumbnail thumbnail '.$figure_class.'" >'.$post_image_before.'<img '.$image.' alt="'.get_the_title().'" >'.$post_image_after.'</figure>'; }
-
Save the changes in the wordpress/wp-content/themes/themeXXXXX/includes/post-formats/post-thumb.php file and upload it to the server.
The final result should look like this:
Feel free to check the detailed video tutorial below:
WordPress. How to remove featured images from posts single pages