Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been looking for a list all WP_Query arguments.

This looks obvious, but http://codex.wordpress.org/Function_Reference/WP_Query isn't helpful at all, "post_type" is mentioned only in an example, and arguments like "posts_per_page" aren't even there.

share|improve this question
    
The WP_Query page is purposely written in that way to detail the methods of the WP_Query class, query_posts lists all the possible args for use with queries, query_posts is just a wrapper/convenience function for the main $wp_query->query() object. $wp_query->query() is also just a wrapper for the $wp_query->get_posts() method. –  t31os Mar 2 '11 at 17:22

2 Answers 2

up vote 4 down vote accepted

I believe this is what you're looking for.

(You're right to look for it on the class documentation...i think the reason why it's on query_posts() is because that (and get_posts()) is meant to be the primarily used function to get posts.)

share|improve this answer

Hi @Wordpressor:

The arguments for WP_Query() are documented on the query_posts() page on the Codex:

And for WordPress 3.1 you can also find the most complete documentation for the WP_Query args on lines 1872 through 2705 of /wp-includes/query.php. :-)

-Mike

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.