• 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.

Viewing 1 replies (of 1 total)
  • Thread Starter Bill Dennen

    (@xyzzy)

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘help with WP_Query orderby’ is closed to new replies.