• Resolved lava-team

    (@hungrygolf)


    This is what I am using for bp profile links on navi menu bar.

    // 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 = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Profile') . '</a></li>';
    		        $menu = $menu . $profilelink;
            		return $menu;
            }

    I need to add “Join Us” when you are not login. so I added like this

    // 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())
           	        $joinlink = '<li><a href="' . wp_register() . '">' . __('Register') . '</a></li>';
    		        $menu = $menu . $joinlink;
    		        return $menu;
            	else
    	        	$profilelink = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Profile') . '</a></li>';
    		        $menu = $menu . $profilelink;
            		return $menu;
            }

    But it’s an error. how I can fix it to work?
    Thanks all the time.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘buddypress "my profile" and "register" links’ is closed to new replies.