Site icon Hip-Hop Website Design and Development

Show Associated Posts by "Category" "by Author"

How can I show associated publish “by class” “by creator”? I take advantage of this code nevertheless it simply shows associated posts by latest posts of creator, not associated posts by class of creator. I’ve carried out some analysis on the web however can not discover a solution.

perform get_related_author_posts() {
world $authordata, $publish;
$authors_posts = get_posts( array( 'creator' => $authordata->ID,'post__not_in' => array( $post->ID ), 'posts_per_page' => 3 ) );
$output = '<div class="rp-users">';
foreach ( $authors_posts as $authors_post ) {
    $output .= '<div class="rp-user-entry">';
    $output .= get_the_post_thumbnail($authors_post->ID, 'related-post-size');
    $output .= '<a href="' . get_permalink( $authors_post->ID ) . '"class="rp-title">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a>';
    $output .= '</div>';
}
$output .= '</div>';
return $output;