The task of wanted to display posts from another site within our multisite setup in WordPress arose recently. We wanted to display recent posts from our Help Pages within the footer of our main site. The solution was very simple, we just added the following code into our themes footer.php file, although this can be put anywhere within your WordPress theme…
<?php global $switched; switch_to_blog(2); //switched to blog id 2 // Get latest Post $latest_posts = get_posts('category=-3&numberposts=6&orderby=post_name&order=DESC'); $cnt =0; ?> <ul> <?php foreach($latest_posts as $post) : setup_postdata($post);?> <li> <a href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>"><?php echo $post->post_title; ?></a> </li> <?php endforeach ; ?> <?php restore_current_blog(); //switched back to main site ?>