WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_posts parameter not working ($orderby) (3 posts)

  1. volleyballmaniac
    Member
    Posted 5 years ago #

    I implemented get_posts in The Loop using the following as a reference:
    http://codex.wordpress.org/Template_Tags/get_posts#Parameters

    Codex states that you can orderby by content as follows:
    $postslist = get_posts('numberposts=10&order=ASC&orderby=content');

    However, the orderby=content parameter does not appear to be working.

    To test I made about 10 posts, and I put a number in each of them (no other content). I then used the code above, but the posts are not ordered sequentially by content.

    I tried other orderby parameters (like title & ID) and they worked as designed, but the content parameter appears to be broken.

    Can anyone shed some light on this? Perhaps a hack or fix?

  2. MichaelH
    Member
    Posted 5 years ago #

    If I'm reading correctly, wp-includes/query.php, in the routine at line 1254, doesn't seem to allow orderby=content.

  3. volleyballmaniac
    Member
    Posted 5 years ago #

    Thanks for your response Michael.

    I appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic