subscribe: Posts | Comments | Email | Twitter     external: Forum | Issue Tracker

How to reorder posts

29 comments
How to reorder posts

Now that finally GD Star Rating from 1.5.0 supports reordering posts on any page using ratings and reviews data, from both standard and multis ratings, it’s time to explain for less experienced users how to do it. And as it turns out, it’s very simple.

Plugin can sort posts using different data. Up to date list of supported columns for sorting is in the info files included with plugin. Also, I plan to add filters to the query, so you can expect regular updates and more features you can use in listing and filtering posts using ratings, reviews or votes.

Currently there are 3 new variables added. They are used to choose sorting column (gdsr_sort), sorting order (gdsr_order) and multi set that will be used, or should the standard rating is to be used (gdsr_multi). Sorting can be done using ratings, number of votes or review ratings. To use it, you can add it directly to the URL (front page, archive, or any other page that is used to get posts).

Here are the URL examples:

  • http://www.gdstarrating.com/?gdsr_sort=rating&gdsr_order=desc
  • http://www.gdstarrating.com/?gdsr_sort=review&gdsr_order=desc
  • http://www.gdstarrating.com/category/tutorials/?gdsr_sort=votes&gdsr_order=asc

First, sorts data descending using ratings. Second sorts by reviews, and third on by number of votes but ascending. Third one is used in a category. If you want to use multi ratings data, you need to add third parameter specifying multi rating set:

  • http://www.gdstarrating.com/?gdsr_sort=rating&gdsr_order=desc&gdsr_multi=4
  • http://www.gdstarrating.com/?gdsr_sort=review&gdsr_order=asc&gdsr_multi=3

But, you can use the same variables to modify queries used by query_posts function. Here are few examples:

query_posts("gdsr_sort=rating");
query_posts("gdsr_sort=review&sort_order=asc");
query_posts("gdsr_sort=rating&gdsr_multi=3");
query_posts("gdsr_sort=votes&sort_order=asc&gdsr_multi=3");

More on how to use query_posts function you can find on official WordPress Codex. As for expanding WP queries, you can expect more in some of the next versions.

GD Star Rating
loading...
How to reorder posts7.01026


  1. perfect-exactly what I needed. Works perfectly! Thank you!

    GD Star Rating
    loading...
  2. Jarno W says:

    Thank you! This is something I’ve been waiting for.

    GD Star Rating
    loading...
  3. Thank you for the plugin…

    But I need some help please…

    I’ve instaled this great plugin, but when I want to show my results in a page I have this columms:

    title votes rating review

    I want to eliminate the column review…

    How do I do that?

    Thank you

    GD Star Rating
    loading...
    • You need to change template used for rendering, and use new template. You have templates map in one of the tutorial and features post. I will also few more default templates for this in one of the next versions.

      GD Star Rating
      loading...
  4. solved :D

    thank you very much mate… you saved the day :)

    GD Star Rating
    loading...
  5. and for reorder comments?

    GD Star Rating
    loading...
    • This is a bit of a problem, since WP doesn’t have the same control for comments as it has for posts. I will definitely add ways to control it, but I am not sure when.

      GD Star Rating
      loading...
  6. I use it but it doesn’t work with me on WP 2.8 , after activate it I have white page .

    GD Star Rating
    loading...
    • You need to give me something more. But most likely you have run out of memory. WP 2.8 uses much more memory than 2.7.

      GD Star Rating
      loading...
  7. I use 1.2.3 version and it’s work fine with WP 2.8

    GD Star Rating
    loading...
  8. Versions after 1.3 are much different, and they require some 20% more memory.

    GD Star Rating
    loading...
  9. Not only do I find your programme hard to use (not got it working yet at all) but your help and documentation is even worse. Stop assuming that everyone is a PC wizz kid and make things simple!

    GD Star Rating
    loading...
    • And what is complicated with reordering posts, for instance? I didn’t made WordPress, and adding query parameters can’t be done any other way.

      GD Star Rating
      loading...
  10. Hi! I’m using your awesome plugin for a Review-Site now.

    So I set up a multi for a Page and got 3 Questions:

    The first one: Can you reorder Posts by Multis?
    The second one: Can you show just the results of the vote on the Frontpage?
    The third one: I just forgot it. :p

    GD Star Rating
    loading...
    • 1. Yes. Read the post again, it’s explained.
      2. Yes. There are shortcode and function for this.

      GD Star Rating
      loading...
  11. Esteban says:

    congratulations for the plugin, my only problem is that my theme is not the function of the widget plugin, I wonder if I should add some code .. thanks

    GD Star Rating
    loading...
    • Again, yes. There are more than 20 functions available for all kinds of integrations. Check info files for details, Builder panel and tutorials.

      GD Star Rating
      loading...
  12. Another valuable function is to sort by thumbs. Here’s how that goes:

    http://www.gdstarrating.com/?gdsr_sort=rating&gdsr_order=desc

    GD Star Rating
    loading...
  13. I’m hoping for a param which lets me specify number of days. For example, I want to display the posts with the most votes in the past week in descending order.

    GD Star Rating
    loading...
  14. Pls GD Rating Top 10 Sidebar Code ..
    Tnx..

    GD Star Rating
    loading...
  15. It is not working for me…
    I am trying to sort the posts on the main page of my blog, by rating.

    I want the highest rated post to be at the top.

    How do I do that using the url method or any other method??

    My website that I am making is lmaowow.com

    thanks in advance.

    GD Star Rating
    loading...
    • Both sorting methods are described in the post. BUT, in some cases url method will not work, because of the multiple loops in the theme. In your case url method described in the post works fine.

      GD Star Rating
      loading...
  16. Hey

    How do I do I re-order posts using the thumbs up/down rating??

    This only seems to work for the star ratings.

    thx

    GD Star Rating
    loading...