Each WordPress post has a featured image, and the featured image will be shown on the WordPress home page above each post title. But at some time this image is not necessary and will cost page load time, so we need to hide it on the WordPress home page to increase page load speed. This article will tell you how to implement it by editing WordPress source code.
1. Hide WordPress Post Featured Image In Index Home Page Steps.
Below are the steps to hide the featured image on the WordPress home page, it will edit the theme source code. It does not need to install any third party plugin. Use a plugin will make your WordPress website run slowly.
- Login to WordPress dashboard.
- Click the Appearance —> Theme Editor menu item on the left side navigation pane.
- On the page right side, select the theme from the drop-down list Select theme to edit, then click the Select button to select it.
- Then navigate to the content/content.php file in the right side Theme Files area.
- Click the content.php file to edit it’s content and remove the code
<?php get_the_image(......)?>which will display the featured image as below.
<?php else : // If not viewing a single post. ?> <!-- comment below code to not display post featured image in index page to improve page speed. --> <!--?php get_the_image( array( 'size' => 'stargazer-full', 'order' => array( 'featured', 'attachment' ) ) ); ?-->