Hide category option from filter bar

Home Forums Calendar Products Filter Bar Hide category option from filter bar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1531223
    sm2dev
    Participant

    Hi,

    Support previous helped me [Help Desk-Ref: 1509722-57295-eab969ee31] add the WordPress core Categories taxonomy to the Filter Bar. I need to hide a category from displaying on the front end. I’m wondering if you can tell me how I do that based on the code that support provided for me previously?

    Here is a link to the code Juan provide: https://gist.github.com/juanfra/be7f4052ebb113278fef88a3a38a5d73#file-tec-filter-bar-category-wordpress-php

    Thank you.

    #1531583
    Victor
    Keymaster

    Hi Daniel!

    Thanks for getting in touch with us!

    First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    If you want to prevent a specific category from showing up in the filter, you can do so by excluding it in the get_terms function. You should modify the following line of the code https://gist.github.com/juanfra/be7f4052ebb113278fef88a3a38a5d73#file-tec-filter-bar-category-wordpress-php-L21

    so that it looks like:

    $source = get_terms( 'category', array( 'orderby' => 'name', 'order' => 'ASC', 'exclude' => array( 16 ) ) );

    where 16 is the category id you want to exclude.

    I hope that helps! 🙂

    Best,
    Victor

    #1548558
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hide category option from filter bar’ is closed to new replies.