Another one of my recent exploits has been in the domain of cross-network aggregation for WordPress multisite installs. What does that mean? Imagine you want to show recent posts from a bunch of different sites in one place. How do you go about it? There are quite a few plugins out there that offer solutions (I think I’ve tested them all), but only one for me that really does the job: WP RSS Aggregator by Jean Galea (aka @wpmayor).
Well, it didn’t do everything I wanted out of the box, but with a little tweaking, the v1 gave me:
- Display flexibility. I need to have multiple instances of the posts displayed in precise places (full custom page & sidebar).
- Limit control. It is also important for me to be able to limit the number of posts that display, possibly with a different number per instance.
- Content control. The title and link to the post isn’t enough. I also need to display the source of the post (the site of origin), the date, and a THUMBNAIL (I’ll come back to that last one in a sec).
- Layout. I’m very picky about the way things look! If I can’t bend it to my will, it’s not worth my time.
- Source control. I don’t necessarily want all of the sites in my network included in the posts displayed. I need to be able to exclude sites.
Sometimes, when working with WordPress, it’s easy to get stuck in WordPress logic and looking for solutions to be found only within its very inner-workings. Not all answers are found in the Loop, however, and this where the Mayor had it right on. Instead of looking to WordPress to run through the list of sites and their most recent posts, he went outside and quite ingeniously used SimplePie, the feed parser used by WordPress, to aggregate content. The first thing this brings to the table, of course, is the fact that it no longer relegates my thinking to my multisite install. I can aggregate content from anywhere with a feed! The second, is that it gives me direct access to the content parsed in the feed to play with as I like.
I hear you asking, “Ok, so that’s the chocolate, but where’s the peanut butter?”
Well, like I said, I had to do a little tweaking initially, and through a series of forum discussions, I contributed solutions/add-ons to further equip WP RSS Aggregator with thumbnails and a way to control the number of posts displayed.
Then the Mayor went and changed everything. Taking lots of feedback from us avid users, he went a step further and converted the very structure of his plugin for the v2 (and now v2.2) that came out in September. Because managing the feeds was a bit primitive, and not many options existed in the v1, he devised a way of converting the parsed feeds back into WordPress using a custom post type and postmeta. Brilliant!
Now, remember me raving about SliderPro? Well, it accepts custom post types. Chocolate, meet peanut butter. This means that I can import my aggregated collection of posts from a selection of sites directly into my slider, for a dynamic and very snazzy display!
Whereas a limit option was integrated into the v2, a thumbnail option was not. So, I have spent the last two days (with a little help from my friends), adding that feature back in. You can see the beginnings of that thought process with code snippets on this forum thread. I’m putting a few final touches on it, and will post the whole updated code to pastebin soon. A live demo will also be available early January.