Featured then Rating Sort Order

This topic contains 1 reply, has 2 voices, and was last updated by  Kiran 6 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #411288

    James Gird
    Expired Member
    Post count: 33

    A while go I implemented the below code snippet for Featured then rating sort order.
    It seem to have stopped working. It now sort again by Featured then data published.
    Example: http://www.kimberley.co.za/places/business/

    https://wpgeodirectory.com/support/topic/sort-by-featured-and-rating/
    // Sorting the listing page results by featured & rating.
    function _gd_custom_sort_by_featured_and_rating( $orderby, $sort_by, $table ) {
    if ( $sort_by == ‘is_featured_asc’ && !empty( $table ) ) {
    $orderby .= ” ” . $table . “.overall_rating DESC, ” . $table . “.rating_count DESC, “;
    }

    return $orderby;
    }
    add_filter( ‘geodir_posts_order_by_sort’, ‘_gd_custom_sort_by_featured_and_rating’, 5, 3 );

    #411314

    Kiran
    Moderator
    Post count: 7069

    Hi James,

    The snippet working fine as expected on my test site.
    Let us provide admin & FTP credentials, so we can look into.

    Thanks,
    Kiran

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket