Hide/Show Header Images On Single Posts

Hi! I love that you have started this forum! What a great idea!

My question is as follows:

Theme: Presence

I would like to show Header Images on “Pages” but hide them on “Single Posts”.

In WPZoom Theme Options/Single Posts Options/Header Image/Display Featured Image at the Top, it appears that it is only possible to turn them all on or all off. There does not appear to be an option to create a distinction between “Single Posts” and “Pages”. (I understand that “Pages” and “Single Posts” are all technically “Posts” but they have different uses and functionalities.)

It is also possible to turn Header Images off post by post using css, which is what I am doing now, but with hundreds of blog posts that is somewhat inefficient.

Another option might be to hide Header Images on selected Single Posts using a taxonomy such as a category.

Does anyone have any thoughts?

Thanks!
Fionn

PS: The one and only Hide Featured Image plugin out there has not been updated in two years and does not work with the current version of WP or the Presence theme.

Never mind! I figured something out that will work!

I thought I would add it here in case it helps anyone. I just added the following to CSS:

.single-post .entry-cover {
display: none;
}

I actually tried this before but inadvertently wrote “posts” instead of “post” :joy:.

I would still love to know if anyone knows of a way to isolate a select group of Single Posts and hide the Header Image using a taxonomy. For example, hide all Header Images for posts from the category “blog”.

Thanks!
Fionn

Hi Fionn,

An easy solution is to add the category name in the tag class, and then hide it via CSS.

Here’s the custom function you will need to add first to your website in order to have the category name in the body class, as it doesn’t appear there by default:

You can add that function using this plugin:

Then the CSS code would look like this:

.single-post.category-YOURCATEGORY .entry-cover {
    display: none;
}

Keep in mind that it should include the prefix “category-” followed by the category name.

Dear Pavel,
Thank you so much for this! Very helpful!

I was able to get it to work!

I confess I tried to edit the functions.php file rather than adding another plugin. Unfortunately, it threw me the “scrape nonce check failed” error when I saved it. So, I downloaded and used “My Custom Functions”, as you suggested, which worked perfectly.

Thanks again!
Fionn