$authors_posts = new WP_Query(
array(
‘author’ => 7,
‘posts_per_page’ => 6,
‘post__not_in’ => array( $post->ID )
)
);

$output = ‘

    • ‘;

while ($authors_posts->have_posts()) {
$authors_posts->the_post();

// Build a comma separated categories list
// You can customize as needed
$categories_string = get_the_category_list();

$image = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘related-author’ );
$output .= ‘

‘;
}

wp_reset_postdata();

$output .= ‘

‘;

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More