1

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.

1
  • 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, 2011 at 17:22

2 Answers 2

4

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

4

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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