Support » Plugin: List category posts » Adding Orderby ID

  • Resolved bloggingthemes

    (@bloggingthemes)



    I have a suggestion for you which will benefit a lot of people who use this plugin, such as myself. None of the orderby options in the widget dropdown list offer the one and very important option of “ID”. The date is OK, but if you’re creating many posts one-after-the-other, this doesn’t work very well.

    I noticed that the best way to ensure descending or ascending order is to do it by ID, so I modified the option list to include the ID:

      public static function lcp_orders(){
        return array("date" => __("Date", "list-category-posts"),
                     "modified" => __("Modified Date", "list-category-posts"),
                     "title" => __("Post title", "list-category-posts"),
                     "author" => __("Author", "list-category-posts"),
    		"id" => __("ID", "list-category-posts"),
                     "rand" => __("Random", "list-category-posts"));
      }

    Now I know you will say “never edit the main files” which is sound advice, but I needed this for the site I am building right now so I just have to remember not to click update on this plugin unless it has the choice I added.

    So my recommendation and request is to make it official and add ID to the option list for “orderby”. Takes just a quick moment to do that 🙂

    How I’m using it:

    I design themes so I need each theme to have it’s own setup tutorial category. I use this plugin to place it in the left sidebar column and I needed the posts to start from the introduction of the theme, then to the installation, etc, etc., but to have it start at the top => downward by using the ID and choosing ascending.

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.