• Wondering if anyone can provide me with some insight here…

    So I’ve been trying to use FAQ plugin that has search capability. I’ve come to learn that this plugin uses WP’s built-in search function and so pretty much searches the entire site instead of FAQ-related content.

    Anyhoo, that would be fine and all, but the website is currently set to redirect on the home page, causing the search queries to break.

    Is there anyway to limit what WP’s built in search will look for?

    Thanks!

    (If more info/examples needed, I’ll be happy to provide that)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Search queries fire the ‘pre_get_posts’ action just like pretty much any other WP posts query does. You can set or unset various query vars to limit the query to anything that is possible for WP_Query objects. To prevent your action callback from limiting all queries, only set or unset vars when is_search() is true.

    Thread Starter jtbuzz

    (@jtbuzz)

    Thanks for your response! I’m still need to WP (and programming in general), so what you’ve described isn’t 100% familiar to me yet. lol But, I’ve picked up a good book to get my feet wet, and will begin learning WP the right way. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Built-in search’ is closed to new replies.