Posted: April 13, 2018 at 9:50 am
This topic was marked as closed however the sample code provided doesn’t appear to work. https://eventespresso.com/topic/hide-category-for-non-logged-in-users/ |
|
Hi there, The topics on this forum self close after a few weeks of inactivity. The code does work if it’s added to a plugin, the plugin is activated, and the correct event category ID is swapped into line 19 of the example. |
|
Thank you Josh – we created a specific plugin for EE4 Customization and added the code snipet to it – trying to hide 1 category but the event still displays in the calendar. |
|
You can do this instead (only works on the calendar)
|
|
Thank you Josh this code does work in the Calendar – what if I need to hide 2 categories? Should I create a parent category for the two and use the parent instead of the category slug? |
|
A slight modification to the code will allow you to add more categories. You change these two lines:
to:
|
|
Thank you Josh – this worked for the Calendar as you mentioned. Could this code be reused with some modification for the Table View plugin? |
|
You can use this one for the Table view plugin: https://gist.github.com/joshfeck/306e3fd441c90de62c4cd0453b029a9f |
|
The support post ‘Hide Categories for non logged-in users (visitors)’ 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.