Support

Account

Home Forums Front-end Issues Query only gives first 10 results

Helping

Query only gives first 10 results

  • This query is only giving me the first 10 results from those terms, I thought that the “numberposts” with value -1 gives all results?

    $args = array(
                  'numberposts'	=> -1,
                  'post_type'		=> 'horse',
                  'meta_query'	=> array(
                    'relation'		=> 'AND',
                    array(
                      'key'	  	=> 'stable_id',
                      'value'	  	=> get_the_ID(),
                      'compare' 	=> '=',
                    ),
                    array(
                      'key'	  	=> 'show_horse_profile',
                      'value'	  	=> 1,
                      'compare' 	=> '=',
                    ),
                  ));
              // query
              $the_query = new WP_Query( $args );
  • numberposts does not work in WP_Query, use posts_per_page

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.