0

I'm trying to find either in the codex or anywhere, the values one can use when making a custom query. I'm trying to learn it but, i'm not sure what it is i'm looking for.

I've gone to places like [ http://codex.wordpress.org/Template_Tags/query_posts ] and [ https://developer.wordpress.org/reference/functions/query_posts/ ] that give good examples on how to use it but for example if i do:

query_posts( array(
     'category_name' => 'name here', 
     'posts_per_page' => 100  
));

I'm aware it may be called something else but in that arrays key/value set above, what i'm looking for is a list that shows all the keys i can use so i can make my own. Any help is greatly appreciated.

3
  • What is it you're trying to do? Or are you just looking for a list of the arguments? If so - here codex.wordpress.org/Class_Reference/WP_Query#Parameters Commented May 6, 2016 at 13:46
  • Yes a list of the things i can use inside that array. Looking at it, kind of like what SIMON below suggested(in the link he provided i mean) Commented May 6, 2016 at 13:49
  • If you read the link that you provided, it states: ***Note: Parameter details can be found in the Parameter section of the WP_Query class article. The examples below also work with the WP_Query object. *** Commented May 6, 2016 at 13:50

1 Answer 1

1

Use get_posts() instead - and if you look at https://codex.wordpress.org/Template_Tags/get_posts you will see a nice big list of all the parameters you can use.

Sign up to request clarification or add additional context in comments.

2 Comments

Hey Simon. thanks 4 the assist. Why should i use get_posts??? is it better in some way?
Take a look at this question and answer wordpress.stackexchange.com/questions/1753/… it gives a lot of detail into why you should use it etc... To summarise query_posts() edits the main query on the site which you really should not be doing. If you want to run a custom query then create a brand new query with get_posts() hence why there is a lot of nice documentation on that with examples. Good luck with it :)

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.