Here’s how I’d attack your problem (in fact I think I’ve written code like this in the past, but I can’t find it at the moment):
$blogs = array( 4, 1 );
$all_posts = array();
foreach( $blogs as $blog ) {
switch_to_blog( $blog );
$args = array( 'posts_per_page' => 10, 'orderby' => 'date', 'order' => 'DESC');
$blog_posts = get_posts( $args );
foreach( $blog_posts as $blog_post ) {
// Add the correct permalink to the Post object
$blog_post->permalink = get_the_permalink( $blog_post->ID );
$all_posts[] = $blog_post;
}
restore_current_blog();
}
usort( $all_posts, '__sort_by_date' );
// Now you can display all your posts
foreach( $all_posts as $post ) {
setup_postdata( $post );
the_title( '<a href="' . $post->permalink . '">', '</a>' );
}
function __sort_by_date( $a, $b ) {
$a_date = strtotime( $a->post_date );
$b_date = strtotime( $b->post_date );
if( $a_date === $b_date ) { return 0; }
if( $a_date > $b_date ) { return 1; }
return -1;
}
Note: I’ve updated the code to get the correct permalink for each post while we’re in the proper site (per your comment/answer below).