Customize filters in search bar

Home Forums Calendar Products Events Calendar PRO Customize filters in search bar

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 7 months ago by michael.millerbasised.com.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1609650

    The SEARCH BAR has three options to search: by date, keyword and location.

    I know that I can completely remove all three by checking the “Disable the Event Search Bar” option in the SETTINGS.

    I know that I can delete just the LOCATION option by checking “Hide location search” option in the SETTINGS.

    How can I remove the date and keyword search, but KEEP the location search?

    I’m looking in the bar.php file and the $filters array – but am not understanding how to remove just the date and keyword filters. I just want the LOCATION search and the FIND EVENTS button. How is this doable?

    #1611161
    Jennifer
    Keymaster

    Hello,

    Thanks for reaching out! You can remove specific fields by adding a little bit of code to the functions.php file of your child theme. We have a guide with some example snippets, but to remove the date and keyword search, you will want to use the following:

    add_filter( 'tribe-events-bar-filters', 'remove_tribe_bar_fields', 1000, 1 );
    function remove_tribe_bar_fields( $filters ) {
    if ( isset( $filters['tribe-bar-date'] ) ) {
    unset( $filters['tribe-bar-date'] );
    }
    if ( isset( $filters['tribe-bar-search'] ) ) {
    unset( $filters['tribe-bar-search'] );
    }
    return $filters;
    }

    Can you give this a try and let me know if it works for you?

    We are limited in the amount of support that we can provide for customizations, but if you get stuck or have any questions, please let me know – I’ll be happy to try to point you in the right direction!

    Thanks,

    Jennifer

    #1628308
    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 ‘Customize filters in search bar’ is closed to new replies.