Quantcast
Channel: Get ALL post types in WordPress in query_posts - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Jules Colle for Get ALL post types in WordPress in query_posts

If you want to use get_posts(), the only work around is to use 'post_type' => get_post_types()Example that returns ALL posts of ANY post type:$posts = get_posts(['post_type' =>...

View Article



Answer by dee_ell for Get ALL post types in WordPress in query_posts

'post_type' => 'any',This gets all posts except revisions. https://developer.wordpress.org/reference/classes/wp_query/#post-type-parametersSo your query would be:query_posts(array('post_type' =>...

View Article

Answer by Nilambar Sharma for Get ALL post types in WordPress in query_posts

You can use 'post_type' => 'any' for fetching from all post types. See this documentation. http://codex.wordpress.org/Class_Reference/WP_Query#Type_ParametersNote: It is highly recommended to use...

View Article

Get ALL post types in WordPress in query_posts

I'm using query_posts to get a list of most popular posts. I'm using several custom post types, and instead of including all of them in the query, I would like a query that just gets all of them, also...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images