Display latest posts of author in a custom post type

You will need to use a WP Query to search for posts of that category.

It will be something like:

 $author = get_the_author(); // defines your author ID if it is on the post in question

 $args = array(
                 'post_type' => 'book',
                 'post_status' => 'publish',
                 'author'=>$author,
                 'posts_per_page' => 5, // the number of posts (books) you'd like to show
                 'orderby' => 'date',
                 'order' => 'DESC'
                 );
 $results = new WP_Query($args);
//    '<pre>'.print_r($results).'</pre>'; // This is a useful line to keep - uncomment it to print all results found - it can then be used to work out if the query is doing the right thing or not.
while ($results->have_posts()) {
$results->the_post();
the_title();
echo '</hr>'; // puts a horizontal line between results if necessary 
}

wp_reset_postdata(); //re-sets everything back to normal       

}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)