Display Author Posts in Buddypress User Profile

Here’s a short Buddypress code snippet which will implement author made posts to their user Buddypress profiles. First it introduces a new profile tab, in this case named My Posts, followed by a simple query to get the author’s posts.

You can easily structure the posts by linking to your specific template part in get_template_part( 'member-posts' ); . For instance, linking archive.php could save time over having to create a new template part.

Finally, if the user isn’t the author of any posts, a message will be displayed in the Buddypress My Post profile tab.

Copy paste the following code to your function.php or bp-custom.php.

 

Leave a Reply

Your email address will not be published. Required fields are marked *