WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sergiofrumento
    Member
    Posted 1 year 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 :)

    http://wordpress.org/extend/plugins/posts-in-page/

  2. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Hi sergiofrumento,

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

    Eric

  3. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year 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.

    Thanks,
    Eric

  4. sergiofrumento
    Member
    Posted 1 year 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 1 year 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!

    Eric

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic