WP Post Sorting Plugin

It all started a couple of days ago, when we were working on an aquarium fish website, and we had some trouble while trying to sort posts within certain categories alphabetically.

We found a plugin called Sort Category Posts By Title that seemed to be just what we needed, but when using it only with specific categories, it wouldn’t work if pretty permalinks were activated.

We also tried Sobek’s Posts in Category, but found out that, even though it still gets about 10 downloads each day, it does not work for WordPress 2.6.3 or higher.

Fortunately, about that time we stumbled upon the Custom Queries page in the Codex, the ‘encyclopedia of WordPress knowledge’. That’s where we found out that there exists a hook called ‘posts_orderby’ designed to do exactly what we needed.

So we figured that since we’re planning to be using more of WordPress in the future as a general purpose Content Management System, we could also contribute by writing this much needed post sorting plugin.

You can download via the official WordPress plugins repository.

To-Do List

  • Sorting for author pages
  • Sorting for tag pages
  • Sorting for the main blog page
  • Sort by custom fields
This entry was posted in WordPress Plugins and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

107 Comments

  1. Posted December 11, 2008 at 7:32 am | Permalink

    Would it be possible with this plugin to do such a tricky sorting:
    1) sort posts tagged with one special word alphabetically (a-z),
    2) sort the rest (or tagged with another special word) alphabetically (a-z) based on the last word of the title.

    It would be a great help for my open project.

  2. Posted December 11, 2008 at 7:33 am | Permalink

    …the idea is I’ve got both people (first name second name) and institutes (just name) so I’d like people to be sorted with their last name, which is sorta… last in the title.

    • Gabriel
      Posted December 11, 2008 at 9:09 am | Permalink

      Hi there, pp.

      Well, first of all, a much simpler solution to your problem would be to create two separate child-categories, one for people and one for institutions.

      And secondly, yes the type of sorting you are suggesting would be a bit tricky. So, while we will consider adding this feature in a future release, we can’t promise anything.

      Good luck with your project,
      Gabriel

    • Gabriel
      Posted December 11, 2008 at 9:26 am | Permalink

      The thing is, our sorting method is closely tied to the MySQL sorting.

  3. Posted December 11, 2008 at 10:55 pm | Permalink

    Thanks for such a prompt reply. The reason I ask for this functionality is that the site is kind of a index, where a user can pick for example “psychotherapy for families” + “a city” and the system shows both individual psychotherapists and psychotherapy centers in the same listing — hence the idea to mix both types of sorting. I understand it is probably very specific system…

  4. Posted January 11, 2009 at 1:17 am | Permalink

    Great plugin – just what I was looking for. Been hunting high and low for a plugin as simple as this that works with 2.7 so great job. Thanks again. Dare to Share

    • Gabriel
      Posted January 11, 2009 at 8:09 pm | Permalink

      :) Thanks. Glad to be of service.

  5. Marc
    Posted January 14, 2009 at 7:36 am | Permalink

    Could you turn this into a “Post of the day” plugin that would randomly pull a post from a category and display using the “Excerpt” in 2.7?

    • Gabriel
      Posted January 14, 2009 at 10:21 am | Permalink

      Hmmm… Please elaborate a little. Where would that “Post of the day” thing occur? Instead of the regular category display? If so, how would the user be able to see all the posts?

      • Marc
        Posted January 14, 2009 at 11:45 pm | Permalink

        Would be great to see one post displayed randomly in the sidebar on a daily basis. It could pull a random post a day from a specific category or tag to display with a title, the excerpt, and a link (or the title could be the link to the original post). I think it would be a great way to give users a chance to see random or older posts on a daily basis that they might not normally go searching for. Also, it could be used as a ‘quote of the day” plug which can pull from a category. Think it can be done?

        • Gabriel
          Posted January 14, 2009 at 11:57 pm | Permalink

          Yeah, it’s a great idea for a plugin (or a widget, actually).

          But I’m sorry to say that it’s not what our plugin is for. As it’s name suggests, our plugin is for sorting posts, and we’d like to keep it as simple as possible. Apparently this is what people are looking for.

          When it comes to WP plugins, swiss army knives don’t seem to be very popular.

  6. Posted January 14, 2009 at 7:03 pm | Permalink

    I’ve installed this plug-in on a blog in WPMU. The basic Default sort drop-down appears, but the categories option is not populated. I suspect this is due to the fact that in WPMU, each blog has it’s own unique taxonomy table, unlike the single table in WP.

    Any idea if there is a work-around for this? (We’re running WPMU 2.6.3)

    Thanks

    Brian

    • Gabriel
      Posted January 14, 2009 at 7:49 pm | Permalink

      So how do plugins work for WPMU ? Do you install them for all users, or just for one user?

      • Posted January 15, 2009 at 11:41 am | Permalink

        In fact both – but in this instance, we have only enabled it for a single blog.

    • Gabriel
      Posted January 14, 2009 at 8:11 pm | Permalink

      Oh, I see, you have installed it on a single blog in WPMU.

      You can try to edit the plugin and replace all instances of wp_tablename with wp_”n”_tablename, where “n” is the blog ID.

      Maybe that will work.

      • Posted January 15, 2009 at 11:45 am | Permalink

        I’d more or less arrived at that conclusion, andI may do this as a quick fix, but ideally I’d like to have the plug-in automatically become aware of which blog it is in, and adjust the table names dynamically to suit. I’ll need to dig into the WPMU Codex to find out how this is done. If I find out, I’ll post the answer back here.

        Thanks

        Brian

        • Gabriel
          Posted January 15, 2009 at 12:51 pm | Permalink

          Cool. Thanks.
          We will definitely do something about the WPMU thing sometime in the future. :)

          Cheers
          Gabriel.

  7. Posted January 17, 2009 at 3:57 pm | Permalink

    So what about sorting post within categories on tags? You think this is possible?

    • Gabriel
      Posted January 17, 2009 at 4:22 pm | Permalink

      yup, it’s clearly possible, although a bit tricky.
      it would be very useful. it’s been on our to-do list from the beginning.

      so, now i’m appending the to-do list to the post.

  8. Posted January 21, 2009 at 11:56 pm | Permalink

    Hi-
    First, GREAT plugin! Just what I was looking for… Nothing too complex, nor too simple. Thank you for this!

    Second, I was having some performance issues on site. I installed a tuner plugin, and it returned that there is an error in the SQL query for this plugin. I thought I’d run it by you to get your thoughts…

    The text of the error is:

    6) Query: [wp-content/plugins/wp-post-sorting/wpps_hook_posts_orderby.php(14): wpdb->get_row()]
    SELECT * FROM wp_post_sorting WHERE category =
    Error in query:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1
    Query time: 0.4821 (ms)

    • Posted January 21, 2009 at 11:58 pm | Permalink

      Nevermind… I just figured out why the error…. Noob mistake. It was because I was on the index page where there *are* no categories.

      Thanks again for an awesome plugin!

      • Gabriel
        Posted January 22, 2009 at 12:13 am | Permalink

        :) You’re welcome, Brian.

      • Gabriel
        Posted January 22, 2009 at 1:43 pm | Permalink

        You know, I found and installed that “WP Tuner” plugin, (which is great by the way) and I also got that SQL error. It apparently was a minor bug, but now it’s fixed.

        • Posted January 23, 2009 at 6:06 pm | Permalink

          If I have another kid, I think I’ll name him Gabriel.

          Thanks!

          • Gabriel
            Posted January 23, 2009 at 6:08 pm | Permalink

            LOL:))

  9. Ray
    Posted February 17, 2009 at 7:09 pm | Permalink

    Hi Gabriel,
    I use your plugin and love it. One question I have. When I do WP_Query in my home.php for a specific category, it does not use the sort order specified for the category that was entered from WP Post Sorting plugin.

    Is there a way I can make a query to leverage the settings that WP Post Sorting has for a particular category. In other words. Something that would replace this query and use the settings for the category:

    have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;
    ?>

    • Ray
      Posted February 17, 2009 at 7:12 pm | Permalink

      Sorry.. that query didn’t display too well…. anyway, the heart of the query is:

      WP_Query(category_name=events)

    • Posted February 19, 2009 at 11:38 am | Permalink

      Hello Ray,

      I’m afraid to say I don’t know of any way you can do it.

  10. Posted March 4, 2009 at 9:06 pm | Permalink

    When is the next version coming out?
    I think it should have the custom fields and also a
    tag that allows users on the website to sort posts.

    Two drop downs would be nice, one having all the chosen custom
    fields as well as title, and date… and the second one where the
    user can select the order: decs, asc… and if u really wanna go all
    out… have it so you can control everything! =)

    Nice plugin by the way.

    Thanks

    • Gabriel
      Posted March 6, 2009 at 12:16 am | Permalink

      Yeah, the new version will definitely have sorting by custom fields, but unfortunately, this requires rewriting the entire plugin from scratch, and we’re a bit tied up at the moment.

  11. Posted March 22, 2009 at 12:59 pm | Permalink

    I am not getting this to work. any suggestions?

    • Gabriel
      Posted March 23, 2009 at 12:22 am | Permalink

      I am going to need a bit more info. What WordPress version are you using? Are you sure you activated the plug-in? Did you go to Posts >> Post Sorting? Is the category list there populated or not? Did you get any errors? Stuff like that.

  12. Posted March 28, 2009 at 10:53 am | Permalink

    Wanted to thank you for this awesome and simple plug-in; on my blog, I have categories for movie/book/game reviews, and it is awesome to be able to show only those categories sorted by title!

    In my particular case, I wonder if it is possible to exclude the word “The” from sorting when it appears at the beginning of the title — for example, so that a title like “The Lord of the Rings” would sort under L instead of T.

    • Gabriel
      Posted March 30, 2009 at 10:20 am | Permalink

      It’s certainly possible, but it would take a fair amount of work. And unfortunately we’re a bit tied up at the moment.

  13. ric
    Posted April 1, 2009 at 12:56 am | Permalink

    This might sound silly, but where does it sort posts? where is the sort displayed?

    And, most, importantly, why do I have to ask this question?

  14. Posted April 8, 2009 at 10:33 am | Permalink

    Hi Gabriel,

    Thanks for developing this plugin!

    It only seems to work for posts filtered in one category. For me, that’s not so interesting.

    I would be really interested to have articles sorted by post title:
    > For ALL postings, (the …. /wp-admin/edit.php landing page)
    > If I filter ther articles by author (I choose one author and display all his / her posts)

    Is this possible? Thanks a lot!

    • Posted April 8, 2009 at 10:39 am | Permalink

      Hello Bart,

      Yeah, it’s possible, but it’s not what the plug-in is doing right now. We might add this functionality in a future version.

      Good luck,
      Gabriel

  15. Posted April 11, 2009 at 11:18 pm | Permalink

    hi gabriel

    i am wondering if you might be able to advise as to how i might sort by title on the single post template level in wp 2.7.x? there appears to be no such parameter for the previous_post_link and next_post_link template tags but that is ‘where’ i would like to implement …

    any suggestions would be VASTLY appreciated :)

    thanks much.

    – joyce lukaczer

    • Posted April 13, 2009 at 2:55 pm | Permalink

      The first way that comes to mind is editing the get_adjacent_post function. You can find it in wp-includes/link-template.php

      Take a look at line 901. You can change “ORDER BY p.post_date” to “ORDER BY p.post_title”

  16. guest
    Posted April 26, 2009 at 8:16 pm | Permalink

    Great plugin. Thank you !

  17. Posted May 12, 2009 at 11:40 am | Permalink

    Works great, thank you

    • Gabriel
      Posted May 12, 2009 at 11:43 am | Permalink

      You’re welcome. I’m glad it helps :)

  18. Posted June 10, 2009 at 10:43 pm | Permalink

    This plugin would be a perfect fit for a project I am working on if it would sort not just category posts, but tag posts as well.

    But your plugin is a big improvement on Alphabetical List, since you can choose a default order for all categories, and override that for certain ones.

    • Gabriel
      Posted June 20, 2009 at 6:50 pm | Permalink

      Great suggestion. I’m adding it to the To-Do List. Thanks.

  19. Posted June 15, 2009 at 6:05 pm | Permalink

    Excellent. Just what the doctor ordered.

  20. Posted July 18, 2009 at 11:32 pm | Permalink

    Hi, great plug-in……..

    although I was looking for something that would actually order the database table everytime a category received a new record,…. so specifically, the Next_link and Previous_link tags would be sorted….

    I have a category of ‘artists’ and when I’m looking at the single post (single.php), I want the next/prev link at the top to show the next/previous in alphabetical order within the category.

    Does your plug-in do this and am I missing how to do it? If not, please add this to the wish list (!) … also, so that the category list in the side-bar will work in alphabetical order… that is until I figure out how to write my own widget!

    Meanwhile, many thanks for sharing your work :)

    • Posted July 24, 2009 at 1:13 pm | Permalink

      The next/prev sort order is hardwired into WordPress.

      See wp-includes/link-template.php

      Look at the line starting with “$sort =”

  21. Posted August 15, 2009 at 4:28 am | Permalink

    Is this plug-in working with 2.8? I’m using WP 2.84, PHP 5.
    I’m trying to sort several categories alphabetically but no matter which way I try, ascending or decending, I end up with reverse alphabetcial, z-a
    I also have several child categories, could that be the problem?
    This plug-in is exactly what I need if it would work. Actually, it does work… just in reverse order. If necessary I’ll leave everything backwards and pretend I meant to do that. LOL
    Thank you so much for the plug-in, I have searched and searched for a way to get posts to sort alphabetically and reverse is better than nothing by far.

    • Posted August 17, 2009 at 10:48 am | Permalink

      The plug-in definitely works on our instance of WordPress 2.8.4, and incidentally we’re also running PHP 5, although it should also work perfectly with PHP 4.

      The fact that you’re using child categories should not be a problem. I have no idea what the problem could be, I’ve never heard of this issue from anyone else. Are you sure you saved the new options and everything?

      • Posted August 18, 2009 at 1:30 am | Permalink

        Yes, I’ve even cleared my cache several times. It’s strange. I have no clue what is going on but like I said, reverse alpha is better than nothing. Thank you for the plug-in. If I stumble upon the reason/solution for this reverse alpha thing, I’ll let you know.

  22. Richard Sapien
    Posted August 17, 2009 at 6:36 pm | Permalink

    You are a God for this. Sorry, I get excited when someone comes up for a simple, effective solution for my problems. Great plug-in, this is exactly what I needed.

  23. Beee
    Posted August 25, 2009 at 7:49 pm | Permalink

    Hi,
    using the plugin on my site but I find one flaw…

    I’m using it to sort posts in the content ‘part’.
    In the sidebar I have a new query which pulls the last 5 posts.
    But now these are ordered alphabeticly as well so it doens’t make any sense…

    Is there a way to stop the sort on a certain point in the page ?

    • Posted August 26, 2009 at 10:49 am | Permalink

      Sure. Just use this filter to switch to the wordpress default sorting:

      function switch_to_default_sorting(){
      return ‘post_date DESC’;
      }

      add_filter(‘posts_orderby’, ’switch_to_default_sorting’ );

      • Beee
        Posted August 26, 2009 at 7:23 pm | Permalink

        Excellent, that does the trick…

        but you might think about removing those rounded quotes (on this site)… i copied it and it gave me an error. took me a couple of minutes before I realised it was the quotes that did it.

        • Posted August 26, 2009 at 7:37 pm | Permalink

          Glad to be of service (:

          • Posted August 26, 2009 at 7:39 pm | Permalink

            PS any expectation when sorting for tags will be finished ??

            I know how to create a new query (as workaround) but not how to seperate them into pages, so eagerly awaiting the updated version ;)

  24. Posted August 27, 2009 at 9:19 am | Permalink

    @Beee:

    It’s no big deal. Just use the WordPress conditional tags:

    function custom_sorting(){
    if ( is_tag(’some-tag-name’) ) return ‘post_title ASC’;
    }

    add_filter(’posts_orderby’, ’custom_sorting’ );

  25. Bill
    Posted September 16, 2009 at 5:42 am | Permalink

    I am using WP2.8.4, I installed the plug-in, set it to sort by title ascending, but the posts remain unsorted. All posts are uncategorized. What am I missing?

    • Posted September 16, 2009 at 10:46 am | Permalink

      Well, this plug-in only sorts posts in specific categories.

      The posts should be sorted in the “uncategorized” category, and only there.

  26. Bill
    Posted September 16, 2009 at 3:20 pm | Permalink

    When I go to Posts>>Edit, and click on FILTER, the posts do get sorted in the “Uncategorized” category. However, it does not follow this sorting sequence in the displayed webpage.
    I am using Thesis Openhook. Do I need to put something in any of the following: Before Post Box or Before Post? There is an option to execute PHP.

    • Posted September 16, 2009 at 3:48 pm | Permalink

      Just add this filter:

      function custom_sorting( $orderby ){
      if ( is_category(’your-category’) ) return ‘post_title ASC’;
      else return $orderby;
      }

      add_filter(’posts_orderby’, ’custom_sorting’ );

      • Bill
        Posted September 16, 2009 at 4:22 pm | Permalink

        Gabriel, I am new to WP. Where exactly do I add this filter?

        • Posted September 17, 2009 at 10:32 am | Permalink

          You can either put in in your theme’s functions.php (i guess this would be the easiest) or make it into a plug-in.

          Pay attention to the quotes, you will need to change them to standard PHP quotes. For some reason my theme always changes my quotation marks to that weird type.

          • Bill
            Posted September 20, 2009 at 5:51 am | Permalink

            OK, after adding it to my functions.php, what else do I have to do so that the “custom sorting” function gets executed when I add a new post?

  27. Posted September 20, 2009 at 7:06 pm | Permalink

    For Bill:

    I now see the misunderstanding.

    The “custom sorting” function does not change the order of your posts in the database. It just sets the order for a MySQL SELECT query. If you added the filter in your functions.php, and it still doesn’t work, it must have something to do with the other plug-ins or with the theme itself. Some wierd interaction.

    Something that you mentioned before comes to my mind:

    “When I go to Posts>>Edit, and click on FILTER, the posts do get sorted in the Uncategorized category.”

    This means that there must be a problem with your theme. Try using our plug-in with the default WP theme, and see if it works.

    • Bill
      Posted September 22, 2009 at 2:38 am | Permalink

      I think the problem is that my theme is not using the MySQL SELECT query, therefore the custom_sorting function is not getting executed. Where and how to add this query?

      • Posted September 22, 2009 at 11:19 am | Permalink

        Wow! I have no idea. How does your theme read data from the database without using a SELECT query? Beats me. Seems impossible…

        • Bill
          Posted September 23, 2009 at 3:00 am | Permalink

          You’re absolutely right. My mistake. My theme MUST be using the SELECT query. Please forgive my ignorance and for wasting your time. I hope that someday I will be able to understand all this. Good luck to your career!

  28. ItWasMe
    Posted September 23, 2009 at 3:17 pm | Permalink

    I just installed the plugin on Wordpress version 2.8.4 and when I change the sort order in the admin the posts don’t reflect the change on the site. Any ideas why?
    Any help is appreciated.

    • Posted September 23, 2009 at 3:20 pm | Permalink

      Do they get sorted in the backend if you go to Posts>>Edit, and you filter by your category?

  29. Posted September 23, 2009 at 6:39 pm | Permalink

    For ItWasMe:

    Try deactivating all other plugins, and see if it works then. While at the same time using the defalut theme.

    The plug-in works with a clean installation of WP 2.8.4

    That’s for sure

    • ItWasMe
      Posted September 23, 2009 at 7:44 pm | Permalink

      I believe you which is why I am confused right now.

      I have the default them on and all the plugins turned off except post sorting.

      The first and third category is set to post title, ascending
      The second category is set to post title, descending

      Yet they all display in the same order.
      http://www.cdmdigitalphoto.com/development/cms/

      • Posted September 23, 2009 at 7:52 pm | Permalink

        Quite weird… I have no idea what’s happening.

        You can try and build the filter yourself. Something like:

        function custom_sorting( $orderby ){
        if ( is_category(’your-category’) ) return ‘post_title ASC’;
        else return $orderby;
        }

        add_filter(’posts_orderby’, ’custom_sorting’ );

        • cindy
          Posted October 8, 2009 at 6:40 am | Permalink

          how and where would I add in this code? will I have to do it for every category?

          and for the return are the options post_title DSC, post_title ASC, post_date DSC, post_date ASC

          • Posted October 8, 2009 at 9:42 am | Permalink

            You could add it in your theme’s functions.php

            If you want all your categories to be the same, you can just use is_category(), with no parameter.

            And yes, those are the return options.

          • cindy
            Posted October 9, 2009 at 5:03 am | Permalink

            I’m a newbie to wordpress. I added the code to the functions.php file and nothing changes. Is there something else I need to add before/after the code you listed above?

          • Posted October 9, 2009 at 10:42 am | Permalink

            It should have worked just like that.

            Did you use any parameter for is_category() ?

  30. cindy
    Posted October 8, 2009 at 6:38 am | Permalink

    I’m running into the same problem as ITWASME. The sorting option doesn’t seem to work under my wordpress 2.8.4.

    Any idea why? if you are working on an upgrade do you know if/when it would be available?

    I’m using wordpress as a CMS for my client and I know the lack of sorting options will bother him.

    thanks for any help that you might have.

    • Posted October 8, 2009 at 9:40 am | Permalink

      I can’t reproduce the error. It works on all our instances of WP 2.8.4

      Try installing a new one, it will certainly work there,

  31. Posted October 8, 2009 at 5:50 pm | Permalink

    Hi all,

    I have the same issue as some above. The posts are sorted correctly within the admin listing of posts when limited by category, but remain sorted incorrectly on the actual site. I’m using the Minimalism theme but have tried the default and classic theme with no other luck.

    I re-created the database awhile back on an earlier version of 2.8, so I don’t think it is an upgrade issue. I still am thinking it is a theme thing… so I’ll experiment more with this.

    Any advice would be much appreciated.

    • Posted October 8, 2009 at 6:15 pm | Permalink

      This is getting weird. Please try it on a fresh install of WordPress… It’s like The Twilight Zone. There’s no way I can reproduce the problem…

      • Posted October 8, 2009 at 11:50 pm | Permalink

        Gabriel,

        My apologies…. I had a navigation error and was looking at a previous install of wordpress / previous site. This works wonderfully.

        Thank you and sorry for any confusion.

  32. Maarten
    Posted October 26, 2009 at 11:32 am | Permalink

    The plugin works great for the categories, but my homepage stays sortated on posts date. Is it my theme (Mandigo), or can it only sort categories?

    Thank you in advance (and sorry for my bad English).

    • Posted October 26, 2009 at 11:52 am | Permalink

      Yeah, it’s only for categories. Look into the posts_orderby hook. Sorting is no big deal.

      • Maarten
        Posted October 27, 2009 at 12:18 pm | Permalink

        Thank you for your quick reply

  33. Posted October 28, 2009 at 5:13 pm | Permalink

    I’m trying to sort by date of event as oppose to date of post.

    will this help?

  34. jeroen
    Posted October 30, 2009 at 8:19 pm | Permalink

    This plugin is just what I needed. have one category i want to change the posts sortorder for by date. I have posts in one category stacked in one page using a custom template I found on the WP site called ‘pageofposts’. But it seems your plugin does not work to change the sorting for this page/category. Do I need to add code to make this work? Would be simple enough to modify the template to change the sortorder but I’m not a programmer unfortunately.

    • Posted November 2, 2009 at 11:52 am | Permalink

      Hello Jeroen,

      If you want to use our plug-in, you need to use the regular category pages. If you use custom templates it will not work. Good luck with your project!

  35. Radek
    Posted November 5, 2009 at 12:39 am | Permalink

    gabriel, are you going to add sorting by custom fields in the near future? if you will do it, you’ll become my biggest idol! :) i have really big need to sort posts (in one category) alphabetically, but not by tittles.
    regards

    • Posted November 5, 2009 at 12:04 pm | Permalink

      Unfortunately it’s not really a top priority for us right now…

  36. Posted November 20, 2009 at 9:09 pm | Permalink

    seems to be incompatible with WP 2.8.6– unless it is conflicting with another of my plugs. i get a blank screen when i browse to your control panel. thanks!

    • Posted November 23, 2009 at 1:57 pm | Permalink

      I’ve just tested it on a 2.8.6 instance, and it’s working properly…

  37. Naveen
    Posted November 24, 2009 at 10:17 pm | Permalink

    The plugin works great … but it is not sorting the posts on the front page… how do we do that?

    • Posted November 25, 2009 at 12:04 pm | Permalink

      You can just add your own custom filter to the posts_orderby hook (take a look here) and use the conditioal tag is_home() and return “post_title ASC”.

      • anthony
        Posted January 22, 2010 at 12:57 am | Permalink

        can you be more specific — am i supposed to add this custom filter to your plug-in’s hook, or the wordpress stylesheet? what exactly will the code look like and where should it be placed in context? thanks!

        • Posted January 22, 2010 at 12:18 pm | Permalink

          no, it has nothing to do with our plugin. and also, it has nothing to do with your stylesheet. you need to put the code either in your theme’s functions.php or in a custom plugin.

          the code goes like this:

          function custom_sorting( $orderby ){
          if ( is_home() ) return ‘post_title ASC’;
          else return $orderby;
          }

          add_filter(’posts_orderby’, ’custom_sorting’ );

  38. Posted January 1, 2010 at 9:51 pm | Permalink

    Hi, Howcan i activate the plugin?
    i have installedit activate it succesfully on my wp admin console but, i dont know how to activate the admin console and the config files, they show (inactive)

    Thanks

    • Posted January 4, 2010 at 2:42 pm | Permalink

      I’m not sure I understand what you’re talking about. Can you see the “Post Sorting” administration menu, under “Posts” ?

  39. Posted January 1, 2010 at 10:43 pm | Permalink

    hi dear, I have downloaded your plugin to use my little project of my native and endangered language (berber) in libya, anyway, its written using arabic alphabet . your plugin works like a charm for the individual categories , what i need it to do is to list in the post page alphabetically for all categories together.
    are you aware or is it possible to use that with your plugin.

    • Posted January 4, 2010 at 2:40 pm | Permalink

      Hey! Unfortunately, the current version of this plugin does not include the feature you mention…

      Good luck with your project!

16 Trackbacks

  1. [...] WP Post Sorting [...]

  2. [...] WP Post Sorting [...]

  3. [...] WP Post Sorting [...]

  4. [...] WP Post Sorting [...]

  5. By Reflection Media. Finally here. | Cozmoslabs on December 11, 2008 at 11:35 pm

    [...] Gabriel made his first plugin for Wordpress, WP Post Sorting. This plugin allows sorting of posts by Post Title (ascending or descending) or Post Date [...]

  6. By WordPress Plugin Releases for 12/11 | BlogBroker24-7 on December 12, 2008 at 2:06 am

    [...] WP Post Sorting [...]

  7. [...] WP Post Sorting [...]

  8. By WordPress Plugin Releases for 12/11 | Web Design Abyss on December 12, 2008 at 10:14 am

    [...] WP Post Sorting [...]

  9. [...] WP Post Sorting [...]

  10. By WordPress Plugin Releases for 12/11 on December 13, 2008 at 4:10 am

    [...] WP Post Sorting [...]

  11. By WordPress Plugin Releases for 12/11 | HLBV on December 13, 2008 at 10:21 pm

    [...] WP Post Sorting [...]

  12. By Skuzzed.com » WordPress Plugin Releases for 12/11 on December 13, 2008 at 11:15 pm

    [...] WP Post Sorting [...]

  13. [...] “WP Post Sorting” Plugin | Reflection Media This plugin allows sorting of posts by Post Title (ascending or descending) or Post Date (ascending or descending), customizable for each category. (tags: wp plugins sort) [...]

  14. By Dezvoltatori români de pluginuri wordpress on September 24, 2009 at 9:02 am

    [...] traducerea wordpress în limba română pentru versiunea curentă și fac o treabă bună, au creat WP Post Sorting Plugin și un plugin care “vorbește” cu tine, Talky [...]

  15. [...] WP Post Sorting: a plugin to list entries in alphabetical order on letter listing pages [...]

  16. By Useful Wordpress Plugins « tips for techies on February 5, 2010 at 3:50 am

    [...] WP Post Sorting – sort posts differently by category – http://www.reflectionmedia.ro/2008/12/wp-post-sorting-plugin/ Possibly related posts: (automatically [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*