Home > OS >  WordPress WP_Query displays only a part of the total posts
WordPress WP_Query displays only a part of the total posts

Time:10-25

Trying to extract all the postst of a certain type but get only 12 of the total of 25. Here is my code. enter image description here

enter image description here

enter image description here

enter image description here

As can be seen the script only outputs the page 2 from the wp admin panel.

CodePudding user response:

Try to replace

'numberposts' => -1,

With this

'posts_per_page' => -1,

CodePudding user response:

You got a 25 posts by this query

$args = array(
    'post_type' => 'your-post-type',
    'post_status' => 'publish',
    'posts_per_page' => 25,
);
  
  • Related