Home › Forums › Calendar Products › Events Calendar PRO › Limit Search to only titles – or don’t search categories
- This topic has 5 replies, 3 voices, and was last updated 6 years, 11 months ago by Communications Dept.
-
AuthorPosts
-
May 10, 2017 at 5:43 am #1281561Communications DeptParticipant
We are running into issues where the event search displays way more events than intended because it appears that Events Calendar is also searching the category.
For this specific example almost all of our events are in a campus category, so if a user wants to search for ‘camp’ – Every event that has a campus category will be displayed in the results.
What steps can I take to limit the search functionality to search ONLY the event title when using the filter bar search?
May 11, 2017 at 12:27 pm #1282522AndrasKeymasterHello and welcome to the forums!
Thanks for reaching out with your question, it is a great one.
That is unfortunately not a functionality that comes out of the box. Please note the normally we don’t support customizations, but give me some time and I’ll check if there is a quick and / or easy solution for that, or something to get you started.
Hang in there, I’ll get back to you soon.
Cheers,
AndrasMay 11, 2017 at 1:25 pm #1282551AndrasKeymasterHello again,
So it looks like that the _issue_ is not with the event categories, but the event descriptions. 🙂 By default the search is done on the title AND the description of the event.
One of my teammates was kind enough to whip together a little snippet that should exclude the event description from the search. Paste this snippet into your child theme’s functions.php file and see if it works:
https://gist.github.com/andrasguseo/4ee91e9daad840e23ef1f0b4c946b147
Let me know if that does the trick.
Cheers,
AndrasMay 24, 2017 at 7:02 am #1288275Communications DeptParticipantThis worked thank you!
May 24, 2017 at 12:59 pm #1288573AndrasKeymasterStoked to hear this did the trick!
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new one in the forum and we will be happy to help you out.
Good luck with your project!
Cheers,
AndrasPS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
https://wordpress.org/support/plugin/the-events-calendar/reviews/PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!
-
AuthorPosts
- The topic ‘Limit Search to only titles – or don’t search categories’ is closed to new replies.