Drop down+sort blog posts date added/most popular

Is it possible to have a drop down menu like youtube/demonoid that allows you to sort your index (and caterogy.php) blog posts by date/popularity/viewed)? I seen plugins for adding most popular widgets or pages, but I was hoping to be able to sort the users page they are looking at (be it the index page or a specific category).

Thanks

Related posts

Leave a Reply

1 comment

  1. Yes, we can sort WordPress posts in different orders, You can do following sorts without installing plugins.

    1. sort post by date ( ascending / descending )
    2. Sort post by title (ascending / descending )
    3. Sort post by comment count ( ascending / descending )
      — These are just basic we can do even more using categories and tags etc

    WordPress already stores the comment count in database but they can not store view counts, ratings / popularity data by default. You must use some kind of plugins to do that. Those plugin will store related data in database and that data can be further used for query.

    EXAMPLES – These queries don’t need any plugins

    1. http://www.example.com/?orderby=date&order=asc
    2. http://www.example.com/?orderby=date&order=dsc
    3. http://www.example.com/?orderby=title&order=dsc
    4. http://www.example.com/?orderby=title&order=dsc
    5. http://www.example.com/?orderby=comment_count&order=asc
    6. http://www.example.com/?orderby=comment_count&order=dsc

    Using custom field values for sorting as per View count / Popularity / Ratings,
    To work this you must install related plugin which store view count as a custom field value.

    To Sort by View Count

    first install this plugin – WP PostViews

    EXAMPLES 3 – Links to sort by view count

    1. http://www.example.com/?v_sortby=views&v_orderby=dsc
    2. http://www.example.com/?v_sortby=views&v_orderby=asc

    Update 1 – july/10

    If you are using GD star rating plugin and want to sort the posts according to their ratings here is more info – http://www.gdstarrating.com/2009/07/03/how-to-reorder-posts/

    HOW TO USE –
    Use links or buttons to those urls and then WordPress will manage all other things.