↧
Answer by mustra for Wordpress: get all posts of a custom type
You should never use:'posts_per_page' => -1It slow and not effective, if you are talking about SQL Query speeds. So it is much better to use some large integer.This is a performance hazard. What if...
View ArticleAnswer by Andrea for Wordpress: get all posts of a custom type
This get all posts of a custom type using get_posts:$posts = get_posts(['post_type' => 'custom','post_status' => 'publish','numberposts' => -1 // 'order' => 'ASC']);
View ArticleAnswer by joseacat for Wordpress: get all posts of a custom type
It is advisable to use an integer instead of '-1' For example:'posts_per_page' => 999999,
View ArticleAnswer by jono for Wordpress: get all posts of a custom type
'posts_per_page' => -1,Add this to the WP_QUERY array of arguments and it should return all of the posts of this custom post type.
View ArticleAnswer by Bobadevv for Wordpress: get all posts of a custom type
The number of posts to return are set under settings > reading You can pass the number of posts for your query to return using.'posts_per_page' => 'number of posts'
View ArticleWordpress: get all posts of a custom type
I have this strange issue. I want to fetch all posts that are of a custom type, here's my snippet.$query = new WP_Query(array('post_type' => 'custom','post_status' => 'publish'));while...
View Article
More Pages to Explore .....