Hi WPMU gang,
I'm new to MU, but not new to WP!
Got a question for you.
I know the switch_to_blog() function exists to list entries from a certain MU blog. But what if I want to list entries from multiple MU blogs in one loop?
Preferably, a cool, hypothetical function such as get_blogs() would exist where I can input the blog IDs and then use good, ol' regular query_posts() to list the entries.
Is there a way?
Thanks for reading.
So you want to list recent posts?
r-a-y,
I aggregate all posts in one blog using Donncha's Sitewide Tags plugin:
http://ocaoimh.ie/wordpress-mu-sitewide-tags/
Then the "ol' regular query_posts()" works fine on that "tags" blog to merge recent posts/tags/cats sitewide.
Then the switch_to_blog(tags_blog_id). . . restore_current_blog wrapper also works from any blog to list posts from the tags blog.
If you only wanted a few blogs insteaded of all of them within a site, I'd just drop the feeds into a service that combines feeds like Yahoo Pipes, grab the feed off of that, and use fetch_rss to display on site.
@andrea_r - Yes, I would like to list recent posts but only for a select number of blogs, not sitewide. Using query_posts is preferred so I can paginate the loop as well.
@dsader - Looks like a cool plugin to use for sitewide usage. I'll use that for a different purpose down the road! Thanks for that.
@tdjcbe - I didn't want to come down to using an aggregated RSS feed, but if I had to, I guess I would use this in combination with FeedWordpress so I can paginate. I guess there's no other way?
r-a-y did you ever figure out what to do because i have the same question?