WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this code that should return all the posts that related to the taxonomy id, but it returns the last 5 posts.

$leaderships = new WP_Query(array(
    'post_type'      => 'posttype',
    'posts_per_page' => 11,
    'tax_query'      => array(
            'taxonomy' => 'taxonomy-name', 
            'field'    => 'id',
            'terms'    => 13,

posts_per_page is not working here, Any help to get all the posts.


share|improve this question
Can you confirm that you have more than 5 posts assosiated with this taxonomy? – Eugene Manuilov Jan 6 '13 at 14:13
I have 7 posts, and when I create a new one it shows first but a one from the 5 is hidden instead. so one added then one hidden. – Ahmad Ajmi Jan 6 '13 at 14:15
do you have any theme code or plugins which may be modifying the query? test by disabling plugins, use default theme. – Milo Jan 6 '13 at 17:54
up vote 0 down vote accepted

Thanks every one for help, I discovered that that the problem is from my theme admin that was limiting the posts to 5 and fixed now.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.