Please copy and paste the code from your author.php template in a pastebin and report the link back here. Thanks.
Hi Michael,
Thanks for replying.
Here is a pastebin link to the code in the author.php file :
pastbin
Here is a link to the live site :
Author post list
I know how to exclude categories. The problem here is that the client will be creating and deleting categories regularly so the only way I can think of getting the author page to work properly with out my regular intervention is to some how only allow one category to be displayed. In this case the blog category.
Thanks for your help
How about:
<?php
if ( is_author() ) {
$author = get_userdata(get_query_var('author'));
echo 'Articles by '. $author->display_name;
$blog_category='1';
query_posts($query_string . '&cat=' . $blog_category);
}
?>
<?php /* get the relevant posts from WordPress DB */ ?>
<?php if(have_posts()) : ?>
Thanks Michael, that fixed it, much appreciated.
I just want to make sure that I understand exactly what is happening here. I am guessing that $query_string is generated by the main loop and by appending the specific category number to the $query_string in the query_posts() function it queries the database for posts matching the new query.
Have I got that right?
Thanks again.
Sounds good except for the “is generated by the main loop” should be “is generated based on the author selected”.