Excluding Events/Categories from main events page
-
Hi,
I am trying to exclude specific events/categories from appearing on the main events page. I have multiple categories and would only like 1 category to be featured on the main events page and the rest to still be viewable/searchable using the WP full Calendar on a separate page.
I tried searching and I have found a few threads but haven’t been able to get it to work. I am total n00b at PHP and new to WP. It appears that If I want to exclude categories/events from the main page I need to edit my “events-list.php” template file. I have followed the documentation on how to use/edit template files and I am having trouble successfully adding a line of code to it.
From what I understand in order to exclude events from appearing on the main page, I have to add this code to the “events-list.php” file:
$args[‘category’] = $_REQUEST[‘-13,-12,-8,-16,-9,-15,-11,-14,-10’]
I have tried adding it and every time I publish a new event it will still show up on the main events page no matter where I place the code. Every event is assigned a category so I am not sure what I am doing wrong.
Can anyone help me out or guide me in the right direction?
Thanks!
- The topic ‘Excluding Events/Categories from main events page’ is closed to new replies.