Limit Search to only titles – or don’t search categories

Home Forums Calendar Products Events Calendar PRO Limit Search to only titles – or don’t search categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1281561
    Communications Dept
    Participant

    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?

    #1282522
    Andras
    Keymaster

    Hello 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,
    Andras

    #1282551
    Andras
    Keymaster

    Hello 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,
    Andras

    #1288275
    Communications Dept
    Participant

    This worked thank you!

    #1288573
    Andras
    Keymaster

    Stoked 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,
    Andras

    PS: 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!

     

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Limit Search to only titles – or don’t search categories’ is closed to new replies.