Support » Plugin: List category posts » Adding Orderby ID

  • 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 4 replies - 1 through 4 (of 4 total)
  • Plugin Support zymeth25



    Thanks for the suggestion. Could you create a pull request with these changes in the plugin’s Github repository?

    I would but I don’t have a git user account and have never used github before.

    Plugin Support zymeth25


    Ok then, I’ll create one later.

    Plugin Support zymeth25


    You can also solve the problem right away without editing any files. Just use the lcp shortcode in the widget. This is the preferred way to use this plugin, we are not focusing development on the regular LCP widget.

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