Forums
Home / Plugins / listing a special author’s posts
(@lametiger)
14 years, 7 months ago
Hey,
I want to list the posts of a certain author on a profile-page. Author XYZ, description, posts… Something like a Social-Network site.
For this purpose I’m writing a special template.
But I already search for hours and didn’t find a solution.
Can anybody help me out?
Thanks a lot!
(@michaelh)
http://wordpress.org/support/topic/307967?replies=2
Thank you. This was not what I was looking for, but finally I found a solution:
$myposts = get_posts('author='.$userID.''); ?> <?php foreach( $myposts as $post) : <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php the_time('d.m.Y, H:i'); echo " Uhr" ?> <?php endforeach; ?>
This works 🙂
PS: This is how I got the $userID …
<?php global $current_user; get_currentuserinfo(); $userID = $current_user->ID; ?>