Hide div by condition if post catergory is not

Hi, in a Single layout I want to hide a div is Post category is not Event. (I want to show post of both categories Event and Nieuws but in a post of Nieuws I want to hide a div with some content that only excists in Posts from category Event. When in Conditions of that div, there is no option to select Post category.

How can I hide that div…?

THX, Carel

Hi Carel,

Thanks for reaching out.
You can use the {{dc:term:name}} in the condition for the DIV element to check if that value is Event or not.

Hope it helps.
Thanks

Now the div is hidden in both categories event and nieuws… The div should be visible in category event and hidden in category nieuws

Naamloos-1

Hey @cvdw,

We highly recommend that you provide us with your login details so we can check your layout and the condition of your DIV element. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hi,

I will send you your login. So It’s the Single layout “Single race” and the div where if category is “event” the is a logo, circuit and a date from - to and when category is “nieuws” there is no logo, circuit and date from -to so in that case I like to hide this div bij conditions.

Hello @cvdw,

Since you are working with a single post layout, use the “Post (has term) has Event” condition.

Kindly let us know how it goes.

YES! Thanks!

You’re welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.