WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] manual orderby function (4 posts)

  1. cranewashington
    Member
    Posted 1 year ago #

    I am trying to display a list of a few selected posts, and I would like the list to be displayed in the same order as given in the shortcode:

    [display-posts id="233, 221, 227"]

    I would like post 233 to be first, post 221 second, and post 227 third. However, the posts are displayed in the default order (order=desc, orderby=date). I tried using "orderby=none", but this just displayed the posts in descending order of title.

    PS awesome plugin, very useful!

    http://wordpress.org/extend/plugins/display-posts-shortcode/

  2. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    Unfortunately that's not an option. Here's the only orderby types: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

    You could just list the shortcode three times though:

    [display-posts id="233"]
    [display-posts id="221"]
    [display-posts id="227"]

  3. cranewashington
    Member
    Posted 1 year ago #

    No worries, that is a good work around, thanks!

  4. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    This is now a feature of WordPress 3.5: http://core.trac.wordpress.org/ticket/13729

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.