Great thread. I'd like to do something a little simpler (I hope!)
I am modifying my author.php template.
I want to show all posts by an author, but I want to restrict results to a single category. Always. So I'm hard-coding the category. However I have multiple authors so I have to pass the author id.
<?php // housekeeping to get the author's name if(isset($_GET['author_name'])) : // NOTE: 2.0 bug requires: get_userdatabylogin(get_the_author_login()); $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; ?> <?php // I just want to show blog posts in cat 6 query_posts('cat=6&author=$curauth'); ?>
This doesn't work. I think my syntax could be wrong, but please let me know if I'm on the right track here.