Hi, I am having a problem with switch_to_blog and restore_current_blog.
WPMU switches to the new blog, but doesn't seem to switch back properly. My code is below. I'd like to switch to a blog, gets some posts, and switch back. The final the_content in the code should show content from the original blog's posts, but it shows the last entry gotten from the blog that's been switched to.
commenting out setup_postdata($post); seems to help a little. the_content works, but the_title does not.
I'm perplexed. Thanks for any help.
--
global $switched;
switch_to_blog(15);
$lastposts = get_posts('numberposts=3');
foreach($lastposts as $post) :
setup_postdata($post);
the_excerpt();
get_the_image();
endforeach;
restore_current_blog();
the_content(); // this should print the_content from the original blog page/post