Changing the ORDER BY in WordPress default search function

Question

My client’s website has a blog category and many product categories. She would like the search results to include the blog posts, but have the product posts first.

I can see two major implementation options

  1. Change the search query in functions.php
  2. Resort the search query results in the search.php template file

My question is: has anyone implemented this task, what implementation method did you use, and what issues did you have in the process?

I have searched for an answer to this specific situation and come up empty.

0
Nora McDougall-Collins 5 months 2020-12-31T12:10:19-05:00 0 Answers 4 views 0

Leave an answer

Browse
Browse