PHP: Need loop to alternate between returned posts
问题 I have a an array of posts that are returned by doing three queries. 3 posts from the blog where posts are NOT in 'In the Media' or 'Insights', 3 from the blog where posts are in 'In the Media' 3 from the blog where posts are in 'Insights'. Here's what I have for that. I don't think it's the most elegant solution: <? $args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'category__not_in' => array( 268, 269 ) ); $homePosts = new WP_Query($args); $args = array( 'post_type' => 'post',