Quantcast
Channel: Wordpress: get all posts of a custom type - Stack Overflow
Browsing all 6 articles
Browse latest View live

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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Wordpress: 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
Browsing all 6 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>