come to think of it, aren’t you putting that code in single.php?
Related:
Template Hierarchy
No I’m putting the code in header.php, which worked so far, the only thing that didn’t work was the category detection on single.php.
The reason I started this post was because I wanted to use minimalized code, sure I could easely put the code in index.php/category.php and single.php instead, but if it’s possible not to, then that would be just a whole bunch greater 😉
Or isn’t this possible because single is in a different hierachy then category.php? And is that the reason why index.php would just take all the new posts also?
And again, here I go 🙂
How do I display posts per specific user ?
something with the_author ?
(The user is a subscriber)
To present links to an author’s posts:
1. Use the template tag, wp_list_authors(), in your sidebar or a Widget.
2. or, use template tag, the_author_posts_link(), in your loop.
To customize and author template read Author Templates
Yeah I know links to authors_posts, but I want to show the posts of specific authors.
Use the template tag, query_posts(), and the author= argument.
<?php
if ( is_page() ) {
$cats = wp_get_post_categories($author->ID);
$args=array(
'cat' => $cats[0],
'showposts'=> 6,
'author_name' => 'Specific_Username'
);
}
$my_query = new WP_Query($args);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?>
I’m beginning to understand this 😉
@michaelh,
Thanks a LOT for all your help!