WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
WP_Query Sorting Problem (4 posts)

  1. Jorge A. Gonzalez
    Member
    Posted 2 years ago #

    Why is this snippit not sorting pages properly? It returns records, but not sorted by gdsr_sort.

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
               $the_query = new WP_Query(
                   array(
                            'gdsr_sort' => 'rating',
                            'gdsr_order' => 'asc',
                            'post_type' => 'page',
                            'posts_per_page' => 10,
                            'paged' => $paged,
                            'post_parent' => $parent
                        )
               );

    http://wordpress.org/extend/plugins/gd-star-rating/

  2. alex.powell
    Member
    Posted 2 years ago #

    I've got the same issue.

    Anyone got a solution?

  3. bbakersmith
    Member
    Posted 2 years ago #

    I have the same issue as well.

    This seems to have been a problem since at least 2010 and the plugin author just doesn't really care.

    More info:
    http://wordpress.stackexchange.com/questions/12892/why-is-that-gdsr-sort-thumbs-gd-start-rating-plugin-only-works-with-query-post

    http://www.gdstarrating.com/2010/09/26/gd-star-rating-1-9-5/comment-page-1/#comment-9662

  4. bbakersmith
    Member
    Posted 2 years ago #

    The workaround mentioned by Cilvic on the above stackexchange.com page works for me.

    In short, just set the GET parameters before using WP_Query.

    $_GET["gdsr_sort"] = 'rating';
    $_GET["gdsr_order"] = 'desc';

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic