How To Hide "Events From Date" Search From Classic Header (Search Bar Disabled)

Home Forums Calendar Products Events Calendar PRO How To Hide "Events From Date" Search From Classic Header (Search Bar Disabled)

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1415552
    ericbonnici
    Participant

    Hello,

    I have the Event Search Bar set to Disabled in my WP Dashboard / ECP settings… So we are using the Classic Header, but the “Events From Date” search is showing.

    Should this be showing if I have Event Search Bar set to disabled?

    And is there an option to hide it, so that the only choices available to our website visitors is to choose a view?

    In addition, is there a way to stop users from using the “Events From Date” search to see past events? (that is only allow them to use it to search for future dates)?

    Thanks
    Eric

    #1415760
    Jennifer
    Keymaster

    Hi Eric!

    Disabling the search bar actually only removes the “Search” field from the bar, but the “Events from” and “Near” fields are not affected. If you want to remove the “Events from” field, you can add the following to the functions.php file of your child theme:

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

    This article has some more info on how to customize the bar.

    To answer your second question, there is not an out of the box way to prevent users from entering a past date to see previous events, but you could change this with a customization. Our themer’s guide is the place to start if you’d like to give this a shot!

    Let me know if that helps and if you have any other questions!

    Thanks,

    Jennifer

    #1415773
    ericbonnici
    Participant

    Hi Jennifer,

    Having the “Events From” field showing is not a big deal. I was just wondering if there was an easy one click option.

    But now I am a little confused because you said:

    “Disabling the search bar actually only removes the “Search” field from the bar, but the “Events from” and “Near” fields are not affected.”

    However, with the search bar disabled option on my site is actually showing only the “Events From” field but not the “Near” field…. so now I am confused… is there a coding error or something not working properly on our site?

    I’m attaching an image to show you…

    Please let me know and thanks

    Eric

    #1419275
    ericbonnici
    Participant

    Hello Jennifer, Just wondering if you or anyone from support will be able to answer my question in my last post above this one in this thread?

    IF not at least please let me know and thank you.

    Eric

    #1420427
    Jennifer
    Keymaster

    Hi Eric,

    I’m sorry for the delayed response here…Do you have the “Hide location search” option (right below the “Disable the Event Search Bar” option) checked? If so, then the “Near” field will also be hidden.

    If you have it unchecked and the field is still hidden, can you please share your system info with me so that I can take a look and see what’s going on?

    Thanks,

    Jennifer

    #1422074
    ericbonnici
    Participant

    Hi Jennifer

    I don’t have the “Hide Location Search” checked… and the field is still hidden.

    I’ve attached an image showing this… I will post my system info in a private message.

    #1422075
    ericbonnici
    Participant

    This reply is private.

    #1423683
    Jennifer
    Keymaster

    Thanks Eric! I did some further testing on this, and it actually looks like the location search is also removed by default when the “Hide location search” option is checked, but the “From” field is not removed. So sorry for the misinformation there!

    If you want to disable the general search and keep the location search, you can use the snippet in this article to remove the general search (with the “Disable the Event Search Bar” option unchecked):

    function remove_search_from_bar( $filters ) {
    if ( isset( $filters['tribe-bar-search'] ) ) {
    unset( $filters['tribe-bar-search'] );
    }

    return $filters;
    

    }

    I hope this clears things up, and if you need any further assistance in getting the correct fields to display, please let me know!

    Thanks,

    Jennifer

    #1424229
    ericbonnici
    Participant

    Thanks for your help Jennifer,

    I actually just wanted to remove all search options and only allow visitors to our website to either choose Month or List view.

    Right now the From search box is showing along with the choice of Month/List views. As I stated before it’s not that big of a deal and not a priority of us to work on right now. We have a lot of other tasks to take care of. We may work on this at some future date.

    But thanks again for your time and help

    Eric

    #1426877
    Jennifer
    Keymaster

    Hi Eric,

    No problem! I’m sorry I don’t have a one-click solution for you here, but I would recommend trying out the snippets here, and if you do want to continue working on this later, please let us know. This thread will close automatically after two weeks on inactivity, but you can open up a new one any time 🙂

    #1445248
    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 11 posts - 1 through 11 (of 11 total)
  • The topic ‘How To Hide "Events From Date" Search From Classic Header (Search Bar Disabled)’ is closed to new replies.