Available since: 1.3
searchwp_search_query_order
By default SearchWP returns results ordered by relevance (as defined by you via the keyword weights set in the SearchWP settings) in DESC
(descending) order. If you wish to modify the order you can add something like the following to your theme’s functions.php
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_search_query_order() { | |
return 'ASC'; | |
} | |
add_filter( 'searchwp_search_query_order', 'my_searchwp_search_query_order' ); |