skip to Main Content

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.

2

Answers


  1. Try to replace

    'numberposts' => -1,
    

    With this

    'posts_per_page' => -1,
    
    Login or Signup to reply.
  2. You got a 25 posts by this query

    $args = array(
        'post_type' => 'your-post-type',
        'post_status' => 'publish',
        'posts_per_page' => 25,
    );
      
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search