The authorpage is begin generated, and every post that an author has made will be shown. However I only want to show posts from a specific category (id=1).
So basically, when you visit
mysite.com/author/John
you should see only posts from John, with category ID=1 and on
mysite.com/author/Bob
you should see only posts from Bob, with category ID=1.
When I do this in archive.php:
/* Start the Loop */
query_posts('cat=1');
while (have_posts()) {
the_post();
get_template_part('content', get_post_format());
}
Unfortunately, when I do this, every post in category 1, will be shown on every author page...(You see Bobs and Johns posts on Johns author-page).
I have also tried this, but same results as above:
$curauth = get_userdata($row->ID);
$user_link = get_author_posts_url($curauth->ID);
$posts = get_posts(array(
'author' => $curauth->ID,
'cat' => 1
'posts_per_page' => -1,
)
);
$post_count = count($posts);
I have 2 questions.
Should I code in archive.php or should I make the adjustments in author.php (not available in the theme).
More importantly, how do I show
catID=1
for every author ?
PS: View full code here