Mobile Theme Hide featured Image on Some Posts

Posted in: Newspaper
Post count: 364

Hi, we use the mobile theme and need to hide the featured image from some posts (using Post Type 5 on Desktop).
They are mixed between different categories and a solution like
@media(max-width:767px){
.category-X .td-post-featured-image{
display:none;
}
}

is not working for us. The post are marked by the tag “gallery”.
How can I hide the featured image with the mobile theme on posts containing the tag “gallery”?

Thanks in Advance.

Post count: 35449

Hello,

So if I understand correctly you want to hide the feature image on mobile theme on those post that have the tag=gallery and on desktop have set the post style 5, if is so please provide me a link to one of your post that you want to hide the featured image, in this way I will be able to provide a custom css for you.

Thank you!

Post count: 364

Hello Calin,

Thanks for your reply. Here are 2 examples:

https://www.starzip.de/stars-frueher-und-heute

https://www.starzip.de/die-witzigsten-bilou-fakes

On mobile, the featured image should be hidden. All posts of this type use the tag “Bildergalerie“, German word for gallery.

Additionally, the image caption font size of all images on mobile smart lists should be like on other normal posts (I don’t understand why it is so enormous big on the mobile smart lists).

Thanks in Advance!

Post count: 35449

Hello,

I think that you can use the the has_tag() -> https://developer.wordpress.org/reference/functions/has_tag/ function to identify the tag that you need and if is in post set a style on feature image

<style>.td-post-featured-image{
display:none;
}</style>

The look of code should be something like this
if(has_tag('Bildergalerie')) {
<style>.td-post-featured-image{
display:none;
}</style>
}

Thank you!

Post count: 364

Hi Calin,
This works great, Thanks for your help!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.