Home › Forums › Calendar Products › Events Calendar PRO › How To Hide "Events From Date" Search From Classic Header (Search Bar Disabled)
- This topic has 11 replies, 2 voices, and was last updated 6 years, 3 months ago by ericbonnici.
-
AuthorPosts
-
January 1, 2018 at 1:17 am #1415552ericbonniciParticipant
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
EricJanuary 1, 2018 at 4:41 pm #1415760JenniferKeymasterHi 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
January 1, 2018 at 5:21 pm #1415773ericbonniciParticipantHi 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
January 5, 2018 at 3:45 pm #1419275ericbonniciParticipantHello 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
January 8, 2018 at 7:45 am #1420427JenniferKeymasterHi 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
January 9, 2018 at 9:03 pm #1422074ericbonniciParticipantHi 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.
January 9, 2018 at 9:03 pm #1422075ericbonniciParticipantThis reply is private.
January 11, 2018 at 9:12 am #1423683JenniferKeymasterThanks 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
January 11, 2018 at 5:09 pm #1424229ericbonniciParticipantThanks 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
January 15, 2018 at 1:22 pm #1426877JenniferKeymasterHi 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 🙂
February 6, 2018 at 8:36 am #1445248Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘How To Hide "Events From Date" Search From Classic Header (Search Bar Disabled)’ is closed to new replies.