Home Forums Theme support Default post search order

This topic contains 1 reply, has 2 voices, and was last updated by  7Theme Support 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • J-B


    I am trying to add a third party search plugin to the ‘Prestige’ Theme, which has not been working. After extensive troubleshooting with the developers of the search plugin, we have found that the error actually lies within the theme itself.

    When ordering search posts by a custom order with the search plugin (e.g. ordering object by Price), the results always order by Descending post date. When looking at the queries caller, this is the message which appears:

    SELECT wp_bwpv63z37h_posts.ID
    FROM wp_bwpv63z37h_posts 
    WHERE 1=1 
    AND wp_bwpv63z37h_posts.post_type = 'search-filter-widget'
    AND ((wp_bwpv63z37h_posts.post_status = 'publish')) 
    ORDER BY wp_bwpv63z37h_posts.post_date DESC

    As you can see, the ORDER BY should not be post_date DESC and instead should be Price (therefore the theme is overriding the search plugin’s query).

    If you could assist in getting this problem fixed by pointing me to the file location where the default ORDER BY data is stored, or if there is a way to disable it completely, that would be great. I have experience in .php edited etc.

    I look forward to your response.

    Many thanks,


    Hi M,

    you can take a look at the file “research.php” in the root of the theme folder, that’s the file that executes the search function. I’m not really sure if the theme is really the problem because in your search query in your post I saw that the post type is “search-filter-widget”, that’s not the post type we used in the theme. But if you want you can take a look at the research.php file, you can try to change “date” to “price” in line 6.

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

You must be logged in to reply to this topic.