WPMU Recent Posts
Jan 14
Hey guys, I just finished a WPMU plugin that brings back recent posts from across the blogs on your site.
When called, it returns a JSON object, or straight, no-style XHTML.
var jsonFeed = <?php $maxPosts = 15; $dateFormat = 'l | M jS, Y'; $feedFormat = 'json'; // can be 'html' also recent_posts($maxPosts, $dateFormat, $feedFormat); ?>;
This will pull back a feed looking like this:
({'posts':[{
'postname':'This is the best post ever',
'date':'Wednesday | Jan 6th, 2010',
'user':'admin',
'author':'Jeremy',
'comment':'no comments',
'blogname':'Super Blog',
'bloglink':'http://192.168.1.10/superblog/',
'permalink':'http://192.168.1.10/superblog/2010/01/06/this-is-the-best-post-ever/',
'thumb':'http://192.168.1.10/superblog/files/2010/01/best_thumb_ever_4.jpg',
'content':'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed ante a eros dapibus tempor.',
'tags':[{
'id':21,
'link':'http://192.168.1.10/superblog/tag/sample-tag',
'name':'sample tag'
},{
'id':22,
'link':'http://192.168.1.10/superblog/tag/historical',
'name':'historical'
},{
'id':23,
'link':'http://192.168.1.10/superblog/tag/blog',
'name':'blog'
},{
'id':24,
'link':'http://192.168.1.10/superblog/tag/interior',
'name':'interior'
},{
'id':25,
'link':'http://192.168.1.10/superblog/tag/programming',
'name':'programming'
}]
}]})
Enjoy and Use!
