1

I am suffreing from an issue from last few days. I have to create a custon nev calls ribbons, that will have some custom functionlity but at the starting steps I am not able to create the nev pages. From lots of R &D I have cerate a code for ribbons custon nev

function custom_setup_nav() {
    global $bp;

    bp_core_new_nav_item( array(
        'name' => __( 'Rebons', 'buddypress' ),
        'slug' => 'rebons',
        'position' => 30,
        'show_for_displayed_user' => true,
        'default_subnav_slug' => 'rebons',
        'item_css_id' => 'rebons'
    ) );

    bp_core_new_subnav_item( array(
        'name' => __( 'Rebons', 'buddypress' ),
        'slug' => 'rebons',
        'screen_function' => 'rebons_page',
        'parent_url' => $bp->loggedin_user->domain . $bp->slug . '/',
        'parent_slug' => $bp->slug,
        'position' => 10,
        'item_css_id' => 'rebons'
    ) );
}

add_action( 'bp_setup_nav', 'custom_setup_nav' );

function rebons_page() {

    add_action( 'bp_template_content', 'rebons_content' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/rebons' ) );

}


function rebons_content(){

    echo 'Put your content here!';

}

From this code I got a option in nev ribbions but when i click on it i shows a 404 not found error_get_last. I have created a file ribbons.php according to profile.php file and aslo created a ribbons folder by copying profile folder and do some changes in files.

But I still getting 404 error. Is I have to registor nev by any functionlity

Please help me guys.

closed as off-topic by Howdy_McGee Sep 13 '16 at 14:47

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.

1

Based on the code you've shown, the main problem is this:

bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/rebons' ) );

Should be this:

bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );

The way you are adding the nav tabs may also be a problem. Here is a gist that might help.

I have created a file ribbons.php according to profile.php file and aslo created a ribbons folder by copying profile folder and do some changes in files.

You shouldn't need to do that. And if you did, it would require creating a custom BP component and adding to the BP template stack - a much more complicated process.

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