Buddypress doesn’t have an actual “page” for a user profile – it is dynamically created. I looked high and low for an answer and finaly came across this solutions. Thanks to Buddyforms, for this bit of code. Place this into your functions.php file and it will do the trick if you want to add a link to the buddypress profile page for users/members. Just change the number 2 to the page ID of the placeholder page.
if( is_page( 2 ) ) {
if(is_user_logged_in()){
wp_safe_redirect( bp_loggedin_user_domain() );
exit;
}
}
}
add_action( 'wp', 'buddyforms_redirect_a_page_to_the_buddypress_profile' );
Leave a Reply