Archived topic
Do not show featured image in a post
9 replies · Started by ian on February 2, 2016
Hi
I do not want to show featured image in a post still want want featured images to show on home page and or catergory pages
Feel I am missing the obvious
Ian
Hi Ian,
something like this?
.page-header-image-single {
display: none;
}
Best regards,
Sven
Thanks, Sven! That's perfect :)
Recently I had the same requirement and as you are extremely busy since yesterday I thought I'd help out!
;-)
Kind regards,
Sven
Thanks to you both
that does work but I did not explain fully enough
I only don't the featured image to show on the post page
If a image is set in the page header addon I still want that to show on the post page
Thanks again
IAn
Interesting - I'm out of office due to my baby being born but hopefully will be back tomorrow evening. Need to inspect some code to see if this is possible.
Will let you know :)
Take your time
Enjoy your baby
Ian
Ok, looked into this.
There's one option, but I'm not sure it will work for you.
When an image is set as a featured image, we add a class to the body element which we can target.
.featured-image-active .page-header-image-single {
display: none;
}
So that will only apply if a featured image is set.
However, if a featured image is set and a page header image is set, it will still apply, so it's not a perfect solution.
Thanks for looking into it for me
That won't work for me you are right
I can work around it though
using
.page-header-image-single {
display: none;
}
and writing my posts in a slightly different way
Thanks again
Ian
No problem - I'll look into writing in better detection so something like this is more possible in the future :)
