Hi Brajesh,
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?
thanks,
VivekHi Vivek,
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.
Regards
BrajeshThanks 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,
VivekHello Vivek,
Try the following URL. It allows you to add a custom tab with demo content.
https://gist.github.com/raviousprime/dd4edd6875709c8d4cc9a2b9bf044652
Regards
Ravi
You must be logged in to reply to this topic.