Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i created a bp-custom.php and regrouped the menu items fine. But now i am trying to add a link to go to /site/members. It list all the members. When i add it though it goes under the profile I am viewing. I am redirecting to a wordpress page if that helps.

example with it added

http://website.com/log-in/members/username/members/

i want it to go just here

http://website.com/log-in/members/

I would love to learn how to just put a url and no slug but whatever works

Here is the function

function mb_bp_profile_menu_posts() {
global $bp;
bp_core_new_nav_item(
array(
    'name' => 'Members',
    'slug' => 'members', 
    'position' => 60, 

     )
  );
}
share|improve this question

put on hold as off-topic by kaiser 2 days ago

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
I have tried parent_url and that did not work at all. –  matthew moore Mar 14 at 20:42
    
Anyone have any ideas on how to do this ? –  matthew moore Mar 16 at 21:06

1 Answer 1

up vote 0 down vote accepted

I know this is not the correct way and you should always edit the template but i just edited the core buddy press navigation function. You will see below the google link I added.

 function bp_get_displayed_user_nav() {
global $bp;

foreach ( (array) $bp->bp_nav as $user_nav_item ) {
    if ( empty( $user_nav_item['show_for_displayed_user'] ) && !bp_is_my_profile() )
        continue;

    $selected = '';
    if ( bp_is_current_component( $user_nav_item['slug'] ) ) {
        $selected = ' class="current selected"';
    }

    if ( bp_loggedin_user_domain() ) {
        $link = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $user_nav_item['link'] );
    } else {
        $link = trailingslashit( bp_displayed_user_domain() . $user_nav_item['link'] );
    }

    echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) );
}

echo "<li id=\"css-personal-li\"><a href='http://www.google.com'>Google</a></li>"; 

}

share|improve this answer

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