Exclude events from search results FRONT END only

Home Forums Calendar Products Events Calendar PRO Exclude events from search results FRONT END only

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #88408
    els76uk
    Participant

    Hello, I previously posted a discussion about a way to hide calendar events from the global site search and was directed to https://tri.be/support/forums/topic/exclude-events-from-search-results/ , where there’s a code which does the trick.

    However, it excludes search results from both front and back end… I only want to exclude results from the front end, of course, otherwise it’s a pain.

    Is this possible?

    #89243
    Brook
    Participant

    Hello els76uk,

    All you will need us a second condition in your code. For instance if you wanted to search events from wp-admin you could use the conditions if ( $query->is_search && !is_admin() ) {..}.

    Will that get it to do what you need? Cheers!

    – Brook

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Exclude events from search results FRONT END only’ is closed to new replies.