I wanted to run a custom query against WP3.0 custom post types but all the documentation and google I found all pointed to posts in categories which doesn’t work if your post type isn’t post, this was my solution….
$my_query = $wp_query->query; // Copy the existing query into a new one $my_query['posts_per_page'] = "30"; // change the number we want displayed. $my_query['orderby'] = "title"; // Sort by title. $my_query['order'] = "ASC"; // 'A' first! query_posts($my_query); // Run our query.... normal service resumes.
Hopefully this post will give someone the light bulb moment they’re after.