I have problem with sort posts according to date:
My code now:
<?php
global $switched;
$original_blog_id = get_current_blog_id(); // get current blog
$blog_ids = array(4,1);
foreach( $blog_ids as $blog_id ){
switch_to_blog( $blog_id );
$args = array( 'posts_per_page' => 10, 'orderby' => 'date', 'order' => 'DESC');
$myposts = get_posts( $args );
foreach ( $myposts as $post ):
setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach;
wp_reset_postdata();
switch_to_blog( $original_blog_id ); //switched back to current blog
restore_current_blog();
}
?>
My problem:
http://images.tinypic.pl/i/00700/vracxlcdm296.png
I would like:
http://images.tinypic.pl/i/00700/jo2yp8f83bce.png
I want to sort by date of all blogs.
Not everyone separately.