This is quite easy, because you can use author
as a parameter with get_posts()
. The following snippet retrieves the 5 latest posts by a specific user, whose ID you need to pass.
$author_ID = bp_displayed_user_id();
$author_posts = get_posts('author=".$author_ID."&posts_per_page=5' );
if($author_posts) {
foreach ($author_posts as $author_post) {
// do output like
echo $author_post->post_title.'<br />'
}
}
Related Posts:
- More posts from the current author
- How to get posts without author?
- Change destination of author link to BuddyPress member profile
- How to use Buddypress xProfile field as WordPress Bio
- get the headlines of the authors’ last post
- How to get latest page (not post) of User and display the content
- How to check if a user (not current user) is logged in?
- Woocommerce: assign an “author” to a product
- How can HTML be allowed in Author Bio?
- Programatically change post author
- Restrict one post per author
- Author page: Comments and Ratings?
- How to display posts by current user/author in a custom page template?
- Add rewrite endpoint to author page + pagination
- How can an author be subscribed to the posts of another author and receive notifications of the new posts?
- Show author archive pages for authors with no posts
- Show the title of the latest post by author
- How we can get the author ID by its Name
- How to hide posts count and posts of other users from edit.php for contributors and authors
- Custom size for image uploaded to custom field in user profile?
- Creating distinct pages for author profiles and lists of posts by author
- Making WordPress author follow button, need missing ingredient
- Get the comment author ID by the comment ID
- Author profile visitors in last 7 days in front end without plugins
- How To Remove The Author(s) From Certain Posts
- Remove /author/ from the author profile url
- Google Authorship on a multi-author blog?
- Replace Gravatar with img URL for avatars
- Change author base slug to user role
- Display Author role in archive or author page
- How to Add Author Editing Capability to Existing Post by Admin
- Limit REST API output to current logged in user that is also author of the content
- Display only entire most recent post on author page?
- Author list ‘special’ author first then ‘normal’ author
- hide something in single page if current author has only one post
- Custom Author Loop
- get_the_author_meta( $field, 0 ) returns the administrator $field
- Showing author’s page with no posts
- Plugin for an author bio popup box?
- How to link to the current User/Author Profile page?
- Author website URL
- How can I get the author description’s excerpt?
- Conditional/Check: IF comment author is the post author
- What do you put in child themes author tag?
- Make user as Default contributor for all Blog Posts
- How to list the authors of all revisions?
- WordPress doesn’t show all posts of a specific author
- Link Author’s Website in Author Bio
- Post list based on the page author
- How to set post author to custom post field via front-end form?
- Show Author information on post page on dashboard
- Author posts url… way to get display name to be url instead of user’s ID?
- Display emails of users who already posted at least once
- Get author’s first name
- Display only author posts in dashboard all posts panel
- Get avatar of the logged-in user in WordPress
- Breadcrumbs – get the author?
- Display author name, outside the loop, if they haven’t published a custom post
- Is author.php a core file?
- Allow Google crawler to crawl specific Author pages
- Clean links in: the_author_meta(‘description’)
- Add Date and Author to Posts
- How to restrict an author scheduling their post date to a maximum X days ahead from the current date
- Different posttypes for different authors
- Create an Author Page on Registration
- author slug in the backend
- Can I Include author login in post class?
- Disable WordPress Comment Author Name
- Get Author Count By Day, Week and Month
- Working with Gravatars within a localhost development area
- Condition within single.php to send an email to the post author
- Author Page Create Link to Page That Lists All Author’s Posts?
- Unpublish Authors With not Fulfilled Fields
- Possible to switch between admin view and author view?
- How to show author page link
- Display all authors in a theme template
- Add Post Author body class to WordPress
- Improving Co-Authors Plus Plugin [closed]
- How to show list authors with at least five posts published
- Display posts differently depending on which author wrote it
- Show Published and Draft posts from Logged in Author
- Best way to set up “reviewed by” in WordPress?
- Filter Author Link for Numerous Authors for each to go to unique page
- WHen I click on post author (on frontend) it doesn’t go to author page
- can’t see information on author page that don’t have posts
- Show text only to the author of the article
- Display Random Post in Author Page
- Show author image at home page latestest posts plugin
- get_author_posts_url() Not working
- How to get the Author type Label Language
- Sticky post of current viewing author?
- How do you display a comment into a mail?
- Author.php display profile for all types of users
- Author Link Not Displaying
- How to get single post by one author?
- Profile Field In Admin Bar
- Permission to change post Author
- why is there an author.php
- How to force the Author Dropdown to display in Quick/Bulk edit?
- How to add avatar to authors list?