I'm using Yoast's Wordpress SEO plugin to generate breadcrumbs for my site. The problem is that when it comes to BuddyPress pages, the breadcrumbs can't see a member's profile page. Right now it shows "Home > Members" on the profile page when it should "Home > Members > Whatever the member's name is".

Here's a snpashot of what I mean

enter image description here

Thanks to @brasofilo I was able to get it. Here's my final code

add_filter( 'wpseo_breadcrumb_links', 'fix_bp_prifile_bc', 10, 2 );
function fix_bp_prifile_bc( $links ) {
    global $bp;
    $user_info = bp_get_user_meta( $bp->displayed_user->id, 'nickname', true );
    //check if we are viewing the profile  
        $links[] = array( 'url' =>'', 'text' =>$user_info );
    return $links;

This is possible using the filter wpseo_breadcrumb_links.

In this example, I'm using the functions bp_get_user_meta and bp_loggedin_user_id, adjust as needed.

To check if the page is child of the Members page (in this example, ID == 2), I'm using the function has_parent grabbed from here.

add_filter( 'wpseo_breadcrumb_links', 'buddy_crumbs_wpse_88889' );

function buddy_crumbs_wpse_88889( $links )
    // apply only in childs of Members page
    // in this example, Members has the ID of 2
    global $post;
    if( !has_parent_wpse_88889( $post, 2 ) )
        return $links;

    $user_info = bp_get_user_meta( bp_loggedin_user_id(), 'nickname', true );
    $links[] = array( 'url' => '', 'text' => $user_info );
    return $links;

function has_parent_wpse_88889($post, $post_id) 
    if ( $post->ID == $post_id ) 
        return true;
    else if ( $post->post_parent == 0 ) 
        return false;
        return has_parent_wpse_88889( get_post( $post->post_parent ), $post_id );

buddypress members breadcrumb

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.