Hi, what is the proper way (if any) to exclude a specific category from the event archive page, I need to exclude the category with the id of 107 from the overall page. I’ve hidden it with css up until now, but now there is a case of the first few events being in that specific category, so the page shows up blank. as seen on http://www.pia.org.za/events/. I am on EE4.
This works perfectly thank you. However, there the category that I excluded is shown on another page on the site (http://www.pia.org.za/event-category/online-events/) so now, if I go to this page, the events there are obviously excluded due to the pre_get_posts filter. I’ve tried to circumvent this by adding another && clause that reads !is_category(107), but this doesn’t work, how do I then show the categories posts on this page?
Nevermind, I forgot that event espresso is a custom taxonomy. just swapped this with is_tax, so all sorted now. Thank you for your quick response on this!
You’re most welcome, I’m glad you found the problem.
Just to clarify for future readers is_category() only works with the WP default taxonomy of categories, as EE uses a custom taxonomy you need to use is_tax() as mentioned.
The support post ‘Exclude specific category from event listings’ 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.