• Hi,

    I’m relatively new to MultiSite. I have a client who really wants three distinct websites, but also wants a homepage that aggregates content from all three sites. Currently, I’m using this bit of code to pull posts from each site:

    <?php
                            global $switched;
                            switch_to_blog(2); //switched to 2
    
                            // Get latest Post
                            $latest_posts = get_posts('category=-21&numberposts=4&orderby=post_name&order=DSC');
                            $cnt =0;?> 
    
                                <?php foreach($latest_posts as $post) : setup_postdata($post);?>
    
    My content
                                 <?php endforeach ; ?>
    
                        <?php restore_current_blog(); //switched back to main site ?>

    The problem is that I would like to include another few posts from this site further down the page, and I’m curious if there’s a way of doing so that wouldn’t allow duplicate posts. Thanks in advance, WordPress community!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Multiple loops on parent homepage’ is closed to new replies.