Use switch_to_blog
to switch blog contexts to a specific blog ID. From there on it’s all down to get_posts
of the attachment
type. And switching back to the current context with restore_current_blog
.
Something like this:
switch_to_blog( $blog_id );
$args = array( 'post_type' => 'attachment', 'numberposts' => 5, 'orderby' => 'post_date', 'order'=> 'ASC' );
foreach ( get_posts( $args ) as $attachment ) {
echo wp_get_attachment_image( $attachment->ID );
}
restore_current_blog();