In this article we will learn how to hide featured image in wordpress. we will perform this in three different sections. how to how to hide Featured Image in Single Post, Single Page, Archive Post and All (everywhere).
When we search something, we see featured image in archive/search page, its good but when we open that page. we also see feature image at the top of th post. How to hide it?
To hide featured image from Single post, page, search page, category page and others, just install “Hide Featured Image” plugin. This plugin allows the user to show or hide featured image.
From setting, we can manage from where we want to hide image.
Without using plugin
In this method, we will edit/change CSS code.
How to hide in single post
To remove this featured post shown at the top of the post/entry, follow these steps;
- Go to web hosting control panel (CPanel).
- Login to Your Account.
- Go to File Manager
- Go to template-parts directory
- Search “content-single.php” and click Edit option
- Find post_thumbnail() attribute, in some themes it is entry_thumbnail(), These codes show thumbnail in post. See below.
- add div tag with style=”display:none;” to hide this image. How to write this, See below
- Click SAVE.
How to hide in Page Post
Revise all above steps but make changes in content-page.php page.
How to hide in Search, Category or Archive Post
Revise all above steps but make changes in content-search.php page and archive.php page
How to hide featured image from everywhere
To do this, follow these steps;
- Open the style.css for the WordPress website and search for “entry-thumbnail”.
- Before the closing brace of “entry-thumbnail”, add the line: display: none;
- Save the style.css
- View the post/page again. The featured image should not be visible now.
The CLASS/ID of the Featured Image would generally be the same for posts and pages. But in some theme it may not be (very unlikely though). Just to ensure, do the same exercise for the feature image on Pages too.
Where you put the “display: none” CSS code is up to you and we shall not get in to the details of that but the options are:
- Directly in the style.css of the WordPress theme (not recommended as it will be lost when the theme is updated).
- In the style.css of the CHILD THEME (okay)
- In WordPress > Appearance > Child Theme > Customize > Additional CSS (if the them supports).