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

    (@dmkizer)

    I reinstalled, and that was not the fix.

    I went into Search.php (under the plugin files) and added this line:

    $orderby = ‘relevance’;

    Right around line 1501, right after this:
    if (!in_array($order, $order_accepted_values)) $order = ‘desc’;

    I DID have the plugin set to sort by relevance, but it was ignoring the dashboard setting for some reason. By forcing the selection within the search.php file, it seems to work.

    Plugin Author Mikko Saari

    (@msaari)

    There’s a query_posts() call on the search results template, and preceding is this line:

    $args = addSortOrderInQuery($args);

    I’ll guess that’s where the date order is being forced on you.

    If that fix of yours works, great – keep it. The next version of Relevanssi will include a filter hook for the $orderby variable, so you can do the same fix without modifying the plugin files.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Order only sorting by Date’ is closed to new replies.