0

Hi i am using the query below to display post from a certain tag term, but what I want it to show multiple post.

So far the query is displaying only 1

<?php
$args = array('tag_slug__and' => array('morning-meat'), 'showposts' => array ('3'),);
$postslist = get_posts( $args );
foreach ($postslist as $post) :  setup_postdata($post); ?>
<ul>
    <li><?php the_title(); ?></li>
</ul>
<?php endforeach; ?>

I can't figure out the problem.

  • Your issue is that it is only returning 1 post instead of 3? Are you sure there are 3 posts with that tag? – Chris Oct 23 '15 at 2:44
0

I believe showposts as been depreciated in favor of posts_per_page

$args = array(
    'posts_per_page' => 3,
    'tag_slug__and' => array('morning-meat')
);

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.