WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
Pagination and Sorting Posts in ascending/decending order ? (2 posts)

  1. liaaz
    Member
    Posted 3 years ago #

    I have set my posts to be sorted in descending order of the rating however I have noticed that the pagination isn't working with that even when I click on the page-2 link it still show the posts from page 1

    here is what I have used for sorting

    $category_id = get_query_var('cat');
    	query_posts(array('gdsr_sort' => 'thumbs', 'gdsr_order' => 'DESC', 'cat' => $category_id ));

    can you please comment that how can I get pagination to work with this ?

  2. Milan Petrovic
    Member
    Plugin Author

    Posted 3 years ago #

    Your query doesn't handle page. Calling it like this will remove all previously set query parameters including page. It's better to work with WP_Query object, and add new parameters for sorting, and than run init() for the object again to pick up new parameters.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic