How to exclude event category from single event meta details list

Home Forums Calendar Products Events Calendar PRO How to exclude event category from single event meta details list

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #970197
    deshub
    Participant

    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!

    #970880
    deshub
    Participant

    hm, dont see this in the forum list, not sure if I submitted it right. I still ned help, thanks!

    #970931
    Brian
    Keymaster

    Hi,

    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

    #970952
    deshub
    Participant

    Thanks 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);

    #971041
    Brian
    Keymaster

    I 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!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to exclude event category from single event meta details list’ is closed to new replies.