I currently have this code in my page template that displays 3 ‘Portfolio’ Items and then 3 ‘News’ Items…

<?php
        $portfolio_args = array(
            'post_type' => 'portfolio',
            'posts_per_page' => 3
        );

        $portfolio = new WP_Query($portfolio_args);

        while($portfolio->have_posts()) {
            $portfolio->the_post();
            $post = new SeedPost(get_the_ID());
            $post->display();
        }
        wp_reset_query();

        $news_args = array(
            'post_type' => 'post',
            'posts_per_page' => 3
        );

        $news = new WP_Query($news_args);

        if($news->have_posts()) {
            while($news->have_posts()) {
                $news->the_post();
                $post = new SeedPost(get_the_ID());
                $post->display();
            }
        }
        wp_reset_query();
        ?>

Would it be possible to alternates how these display? so instead of displaying like this:

Portfolio    Portfolio    Portfolio 

News         News         News

It displays like this:

Portfolio     News         Portfolio

News          Portfolio    News

Many thanks

Read more here: Alternate post types in WordPress template


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: