WordPress.org

Ready to get started?Download WordPress

Forums

help with WP_Query orderby (2 posts)

  1. Bill Dennen
    Member
    Posted 2 years ago #

    Hi,

    I am trying to query a custom post type using WP_Query. It works fine, except for the orderby parameter. No matter what I set it to, I get the same order. Here's some code:

    $quilts = new WP_Query( 'post_type=profiles&post_status=publish&orderby=rand' );

    Again, I can change the orderby and the order stays the same.

    Any idea what might be causing this?

    thanks.

  2. Bill Dennen
    Member
    Posted 2 years ago #

    Maybe part of the problem is that I am actually doing this outside of WordPress. My PHP script has this to include WordPress:

    require('/home/dir/public_html/wp-load.php');

    Everything else works fine, except for the sorting. Weird.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.