insert in WP menu a tab that link to Bp profile.
-
hello
Word press 3.8.1
buddypress1,9,2
i can t put site cause it’s on localIn the wordpress menu I would like to add a link to the buddypress user profile. I would like to create a new tab on my main menu called “My Profile” that redirects to the unique buddypress user profile page. My problem is that these links are dynamic based on the username.
What I would like to achieve:
–>User1 logs in and clicks on http://website.com/my-profile and is redirected to http://website.com/members/user1/profile/–>User2 logs in and clicks on http://website.com/my-profile and is redirected to http://website.com/members/user2/profile/
i have tried the solution of that old post where it was proposed to add the code below at the end of function.php of theme
}
// Filter wp_nav_menu() to add profile link
add_filter( ‘wp_nav_menu_items’, ‘my_nav_menu_profile_link’ );
function my_nav_menu_profile_link($menu) {
if (!is_user_logged_in())
return $menu;
else
$profilelink = ‘‘ . __(‘My Profile’, ‘buddypress’ ) . ‘
‘;
$menu = $menu . $profilelink;
return $menu;
}
?>but this one does not work certainly because it’s for old version of buddypress 1.5
does anyone has a solution that suit the new version of Buddypressthanks a lot for answear.
- The topic ‘insert in WP menu a tab that link to Bp profile.’ is closed to new replies.