Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

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

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

Thanks

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

1 Answer 1

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

 
discard

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.