Skip to main content

Filter Content by Author, for WP 1.2+

Here is my updated hack to allow you to filter the front page of your blog by author if you have more than one as I do:

<?php function author_list() { global $tableusers; $query = ("SELECT ID, user_nickname from $tableusers ORDER BY user_nickname"); while ($data = mysql_fetch_row($result)) { echo "<a href="".$blog_file."?author=$data[0]">$data[1]</a> ::<br />n"; } ?>

Place this in your my-hacks.php file and then place the function call <? author_list() ?> in the page where you would like to have this list displayed and that is it.  If you would like to have a text file of this to download, you can find it here (if you are using Safari, you won't see the code, just save the file).  And remember this code is realeased under the same license that is in use on this site, so use it accordingly.

Discussion

Login Required

You must be signed in to post to this board.

Registered users only · No anonymous posting

No messages in this thread yet.