This snippet will show the last posts by the current author in Wordpress.
<?php
//Gets category and author info
global $wp_query;
$postauthor = $wp_query->post->post_author;
$tempQuery = $wp_query;
$currentId = $post->ID;
// related author posts
$newQuery = "posts_per_page=5&author=" . $postauthor;
query_posts( $newQuery );
$authorPosts = "";
$count = 0;
if (have_posts()) {
while (have_posts()) {
$count++;
the_post();
if( $count<4 && $currentId!=$post->ID) {
$count++;
$postsbyauthor .= '<li><a href="' . get_permalink() . '">' . the_title( "", "", false ) . '</a></li>';
}
}
}
$wp_query = $tempQuery;
?>
Put the following line where you want the data to be shown in your post:
<ul> <?php echo $postsbyauthor; ?> </ul>
