The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Posts in Page
[resolved] How to order also by date the posts I'm showing by category? (5 posts)

  1. sergiofrumento
    Posted 3 years ago #

    Hi WordPress.org users, I have a question.
    I used this comfortable plugin to make different pages on the same domain, and so I put the code [ic_add_posts category='category-slug'] on a page that I wanted to show only the posts of a certain category.

    It worked great, but I need one more function: the posts have to be shown beginning by the older ones (normally WordPress order posts beginning with the last ones).

    I saw that in other code examples there is a function that remind me to this feature: [ic_add_posts orderby='title' order='ASC']

    Unfortunately, adding to the code [ic_add_posts category='category-slug'] order='ASC' or order='DES' or order='DESC' had no effects.

    It's possible to order the posts of a category by date?

    Thank you for the answers :)


  2. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 3 years ago #

    Hi sergiofrumento,

    It should work using the shortcode. I'll check a few things and get back to you shortly.


  3. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 3 years ago #

    Hi sergiofumento,

    Looks like you need to set the orderby as well. We'll update this in a future version, but right now, you'll want to try something like this:

    [ic_add_posts category='category-slug' orderby='date' order='DESC']

    I hope that helps.


  4. sergiofrumento
    Posted 3 years ago #

    It works! Thank you very much Eric, I promise to you a donation if I will ever earn something from my site. :D

    Just to help other users, the code that Eric suggested to me mantain the usual order of WordPress's posts (the new ones as firsts), to invert it you have to write 'ASC' instead of 'DESC'.

    Thank you again for the plugin and for your help!

  5. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 3 years ago #

    You're quite welcome!

    You're right, if you want to invert the order from what I listed above, you'll use:

    [ic_add_posts category='category-slug' orderby='date' order='ASC']

    Have a great day!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts in Page
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic