29

How to reorder posts

DiggThis
Thumbnail for 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...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
How to reorder posts, 7.2 out of 10 based on 42 ratings

29 Responses to “How to reorder posts”

  1. Erika

    July 3, 2009
    at 5:12 AM

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

    GD Star Rating
    loading...
  2. Jarno W

    July 3, 2009
    at 4:50 PM

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

    GD Star Rating
    loading...
  3. adi

    July 4, 2009
    at 5:47 PM

    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...
    • MillaN

      July 4, 2009
      at 5:56 PM

      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. adi

    July 4, 2009
    at 7:48 PM

    solved :D

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

    GD Star Rating
    loading...
  5. Javier Serer

    July 5, 2009
    at 5:12 PM

    and for reorder comments?

    GD Star Rating
    loading...
    • MillaN

      July 5, 2009
      at 5:24 PM

      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...
      • Javier Serer

        July 5, 2009
        at 5:27 PM

        ok thanks, it’ll be really interesting.

        waiting for see it as soon as posible :)

        regards.

        GD Star Rating
        loading...
  6. Waseem

    July 5, 2009
    at 10:07 PM

    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...
    • MillaN

      July 5, 2009
      at 11:18 PM

      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. Waseem

    July 5, 2009
    at 11:51 PM

    I use 1.2.3 version and it’s work fine with WP 2.8

    GD Star Rating
    loading...
  8. MillaN

    July 6, 2009
    at 12:21 AM

    Versions after 1.3 are much different, and they require some 20% more memory.

    GD Star Rating
    loading...
  9. DWO

    July 7, 2009
    at 8:49 PM

    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...
    • MillaN

      July 7, 2009
      at 9:11 PM

      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. Cruelty

    July 18, 2009
    at 2:29 PM

    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...
    • MillaN

      July 18, 2009
      at 4:07 PM

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

      GD Star Rating
      loading...
  11. Esteban

    July 18, 2009
    at 2:51 PM

    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...
    • MillaN

      July 18, 2009
      at 4:06 PM

      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. dumbmedicine

    July 21, 2009
    at 10:18 PM

    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. dumbmedicine

    July 21, 2009
    at 10:19 PM

    doh

    Sort this way:

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

    GD Star Rating
    loading...
  14. Erika Jurney

    July 22, 2009
    at 6:33 PM

    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...
    • MillaN

      July 22, 2009
      at 7:52 PM

      More and more filters will be added.

      GD Star Rating
      loading...
  15. Omer

    July 28, 2009
    at 9:05 AM

    Pls GD Rating Top 10 Sidebar Code ..
    Tnx..

    GD Star Rating
    loading...
  16. John

    July 31, 2009
    at 5:48 AM

    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...
    • MillaN

      July 31, 2009
      at 12:20 PM

      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...
  17. Chad

    July 31, 2009
    at 9:09 AM

    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...
    • MillaN

      July 31, 2009
      at 12:21 PM

      Use the same methods from the post. But also check the info files for all support WP_Query modifications. Many more are added since the post is published.

      GD Star Rating
      loading...

Comments are closed.

Social Networks

Subscribe via Feedburner Flickr Images Stumbleupon Profile
xScape Themes

Feedburner updatesFeedburner

Sign up to receive all latest news about GD Star Rating directly to your email.