• myladeybugg

    (@myladeybugg)


    Hello,

    I am looking to pull the most recent post from specific blogs on my multisite. The only way I can think of at this time to do this would be to use the blog ID. I have looked at the recent posts plugins, but I do not believe there is one where you can choose to pull a post by blog ID, although I could have missed it.

    Would this be possible? I am looking to display avatar, title, excerpt, and possibly featured image.

    Thanks!

Viewing 1 replies (of 1 total)
  • If you are looking to loop through recent posts of a specific blog, wrap your loop with switch_to_blog and restore_current_blog functions:

    <?php switch_to_blog(1); ?>
    		<?php if ( have_posts() ) : ?>
    
    			<?php /* Start the Loop */ ?>
    ...
    		<?php endif; // end have_posts() check ?>
    <?php restore_current_blog(); ?>

    Or/And

    If you want an aggregated index of posts from every blog in the network, you’ll want to have a look at WordPress MU Sitewide Tags Pages.

Viewing 1 replies (of 1 total)

The topic ‘Recent Posts by Blog ID’ is closed to new replies.