I need to get all posts created by a specific author. For example, all the posts created by author ‘test’. For each post I need the post title, description and featured image. Can anyone help?
if(isset($authors) && !empty($authors))
{
echo "<ul>";
foreach($authors as $author)
{
$posts = get_posts(array('test'=>$author->ID));
}
}
2
Answers
You can do it something like this
Get get_current_user_id() or enter the user id returns the users and finally get particular author post