Support » Plugins » Small solution: Combined RSS feed (post comments)

  • As I couldn’t find a hack or plugin that did this easily, I whipped up a small PHP script today that builds an RSS (RSS2) feed that contains the latest 10 posts and their comments in one simple feed.

    DISCLAIMER: I did some basic tests of this code on a friend’s blog, and it checked out ok…which doesn’t mean it’s 100% guaranteed fault free. Also the code is quite quick ‘n’ dirty, feel free to adapt and use in whatever way you want, but please give credit, my ego needs feeding too 🙂

    GET IT:

    1. Download the source code here.

    2. Save the file with extension ‘.php’ (so change the ‘.txt’ extension), and upload to the root of your WordPress directory.

    3. Access the url to the file (i.e.: http://www.yoursite.com/wp-rss2-combined.php) using your favorite RSS reader to test and verify it’s working.

    If you wish to change the number of posts shows in this feed, open the file in a text or web editor, and find these lines near the top of the file:

    // how many posts to show?
    $limit = 10;

    Change the number to whatever you want and hey presto!

    Do enjoy, comments are welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Mark Kathmann

    (@kathmann)

    Small update: feed now also shows author names with the comments, and link (if entered).

    Kathmann – I like this little code… thank you very much. BUT at the moment I only have the feed showing my posts and not my comments. Can you think of anything I may have done wrong?!

    Andy.

    andyclarson

    (@andyclarson)

    this sounds great and is exactly what i’m looking for, but i can’t download it at the moment as your site is down 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Small solution: Combined RSS feed (post comments)’ is closed to new replies.