Featured: Pink for October

Sillyness, werd


Entry: Author RSS feeds


 

Meta & Errata


This hack will query your database, returning all the authors and constructing the RSS feeds for each on the fly.  You can see it in action in my menu bar to the right, under RSS for each author.

Insert this into your my-hacks.php:

function author_rss() {
global $tableusers;
$query = ("SELECT user_nicename, user_nickname from $tableusers ORDER BY user_nickname");
$result = mysql_query($query);
while ($data = mysql_fetch_row($result)) {
echo "<a href="/index/author/feed/$data[0]/rss/">$data[1]</a> ::<br />n";
}
}

Then just throw this in your index page where you would like the list to appear:

<?php author_rss(); ?>

That is all there is to it, as always here is a text file.

 

Comments & Pontifications


  1. personal avatar yuri vieira
    Stroll on over and visit yuri vieira
    March 1, 2007

    Hi Chris
    Can I use this hack with wordpress 2.0?
    Thank’s
    Yuri

Leave a Reply