Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pccmarkets

    (@pccmarkets)

    Thanks Mikko. I see why they went down the path that they did as some of our custom search templates need to function without a search term (no “s” query parameter), but I was able to revise using pre_get_posts, which we were already using. Otherwise, I might have tried relevanssi_modify_wp_query.

    Thread Starter pccmarkets

    (@pccmarkets)

    I believe I determined the source of the problem, which is (of course) not with the Relevanssi plugin but how the custom search template was implemented. Because the custom search template is using the ‘s’ query parameter, the standard/main search query is being executed. But the template is building its own separate query, which is where the ‘post__in’ arg is being passed. I believe both the main search query and the custom one are being executed (hence the unnecessary queries for irrelevant posts), though only the results from the custom query are being displayed.

    I believe using the ‘pre_get_posts’ hook is the proper way to achieve the desired results. If anyone has other thoughts, they are welcome. Thanks!

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