• I got my issue solved with a custom SQL Query but was just wondering if anyone out there knows of more of a ‘built-in’ way to customize the search feature for WordPress sites. I had a client that insisted on filling in Descriptions of a custom taxonomy and then was not happy when said taxonomy did not show up in a search. I had to add results to the existing search results by running my query specifically checking the taxonomy description field for the search keyword.

    Thoughts for the future?

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Ideally you want to run one all encompassing query to cover all search columns. Typically we alter the query by hooking ‘pre_get_posts’ and setting, changing, or removing query variables as needed. In the case of taxonomy descriptions, I don’t think that can be accomplished through query variables, so we need to directly modify the mySQL query. There are filters available for each clause in the query. Hook the one you want to change. If you can’t simply append or replace the clause entirely, parsing the existing clause can get tricky.

Viewing 1 replies (of 1 total)

The topic ‘Custom Searching…’ is closed to new replies.