0

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

3
  • 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
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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