Home › Forums › Calendar Products › Events Calendar PRO › How to exclude event category from single event meta details list
- This topic has 4 replies, 2 voices, and was last updated 8 years, 11 months ago by Brian.
-
AuthorPosts
-
June 17, 2015 at 12:23 pm #970197deshubParticipant
I’ve got a category i’m using for some sorting functions, but I would rather it not show up in the single event meta details list of categories. I was hoping that it would work similar to WordPress’ ‘wp_list_categories’ function, so I tried adding a line to the parameters/args for the ‘tribe_get_event_categories’ function, to exclude the particular category ID i want to hide, but it doesn’t seem to work:
‘exclude’ => ‘369’
I tried to find a list of parameters that the ECP function accepts (other than what I can see in ‘single-event.php’), but no luck.
Is there anything I can pass to that function to omit a category ID or slug from the list of meta details categories? Here is a page I’m working with as a test, I’d like to exclude the first category, ‘Annual Saline Event’.
http://www.visitsaline.content-hub.net/event/saline-celtic-festival/2015-07-10/
Thanks!
June 18, 2015 at 6:27 am #970880deshubParticipanthm, dont see this in the forum list, not sure if I submitted it right. I still ned help, thanks!
June 18, 2015 at 8:03 am #970931BrianKeymasterHi,
Thanks for using our plugins I can try to help out here.
Our function does not accept arguments to exclude event categories.
However, you could replace it with get_terms:
https://codex.wordpress.org/Function_Reference/get_terms
They have examples on that page on how to use that function to show terms.
The Event Calendar category is registered as tribe_events_cat
Let me know if you have any follow up questions.
Thanks
June 18, 2015 at 8:58 am #970952deshubParticipantThanks for the tip, Brian, that works fine!
$taxonomies = array(
‘tribe_events_cat’,
);$targs = array(
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘hide_empty’ => true,
‘exclude’ => ‘369,378’
);$terms = get_terms($taxonomies, $args);
June 18, 2015 at 12:12 pm #971041BrianKeymasterI am glad to see you were able to figure it out and thanks for sharing the coding.
I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘How to exclude event category from single event meta details list’ is closed to new replies.