So I am using the code below to retrieve the latest 5 posts from 5 different categories.
The problem is that it outputs the latest 5 posts from only the first category in the array, even if there are newer posts in the other 4 categories.
If I remove the first category from the array, then it simply outputs the latest 5 posts from the next category in the array. It never gets to the remaining categories.
What I wanted to do was to output the newest 5 posts from all the 5 categories combined. What can I do to fix that?
<?php $args = array( 'posts_per_page' => 5, 'category' => 15,16,17,18,19); $myposts = get_posts( $args ); ?> <?php foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <?php the_title(); ?> <?php the_content(); ?> <?php endforeach; wp_reset_postdata();?>