Support » Plugin: Relevanssi - A Better Search » Results order Divi Extra Theme

  • Hi,

    We just switched themes to Extra (Divi) by Elegant Themes. And our search results are showing up by order of date (newest to oldest) rather than weighted by Relevanssi.

    Here is my current search.php:

    Any help appreciated!

    Debbie McCormick

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari


    Add this to your theme functions.php:

    add_filter( 'relevanssi_modify_wp_query', function( $query ) { $query->set( 'orderby', 'relevance' ); } );

    Does that fix the problem?

    Thank you for your reply. However, adding that to functions.php did not help. Actually, it made all searches result in “no posts found”.

    Still hoping you can assist.

    Thank you.

    Plugin Author Mikko Saari


    It was missing the return:

    add_filter( 'relevanssi_modify_wp_query', function( $query ) { $query->set( 'orderby', 'relevance' ); return $query; } );

    This should work better.

    Perfect! Thanks so much.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Results order Divi Extra Theme’ is closed to new replies.