The MU forums have moved to WordPress.org

Is there a way to merge entries from multiple blogs into one loop? (7 posts)

  1. r-a-y
    Member
    Posted 14 years ago #

    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.

  2. andrea_r
    Moderator
    Posted 14 years ago #

    So you want to list recent posts?

  3. dsader
    Member
    Posted 14 years ago #

    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.

  4. tdjcbe
    Member
    Posted 14 years ago #

    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.

  5. r-a-y
    Member
    Posted 14 years ago #

    @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?

  6. shodezignz
    Member
    Posted 14 years ago #

    r-a-y did you ever figure out what to do because i have the same question?

  7. shodezignz
    Member
    Posted 14 years ago #

About this Topic

  • Started 14 years ago by r-a-y
  • Latest reply from shodezignz