I would like to have a BP profile tab which lists the posts authored by the currently viewed member, and redirect the authors archive page to this new tab.
I saw this post : https://buddydev.com/redirect-wordpress-author-archive-buddypress-profile/
which would serve the second part (except i dont know how the set the new tab url in redirect url)
Would you have any snippet available to do this?
Please visit the posts screen on user profile and note down the part after username.
For example, if it is http://example.com/members/vivek/abc/xyz
our slug is ‘abc/xyz’
After that, Please change this line
$redirect_url = bp_core_get_user_domain( get_queried_object_id() );
with that slug as
$redirect_url = bp_core_get_user_domain( get_queried_object_id() ) .'abc/xyz';
Hope that helps.
Thanks very much for this, Brajesh.
However, I do not have a My Posts tab in the profile. For the first part of my query, would there be any snippet to add the My Posts tab into the profile? I tried this one, and it inserted a My Posts tab, but it is blank: https://jonaskjodt.com/display-author-posts-in-buddypress-user-profile/
Any suggestions on how to get the tab with the user’s posts listed in it?
thanks very much,
Try the following URL. It allows you to add a custom tab with demo content.
You must be logged in to reply to this topic.