Hi folks,
I’m trying to hide all events with the event category “private” from appearing anywhere on the site. I’ve gotten everything except for the People template covered.
Here’s my version of the EE People template:
But neither make a difference in the outcome. I obviously have some incorrect syntax here, but I can’t seem to figure out the right syntax.
Can you help?
has_term() works on the global $post object if you don’t pass in an ID/Post to the function, the $event variable in that foreach loop is not the global $post object at that point so it won’t work as-is.
You need to pass the event’s ID to has_term, like so:
That makes perfect sense. Thanks so much, Tony! It’s working now.
Viewing 2 reply threads
The support post ‘Exclude events of x category from appearing in People posts’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.