Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Assigning New Subnav Items

  • @emidio007

    Participant

    I have researched how to add a new item in the navigation and I understand how it works. I’m trying to assign a new Subnavigation in messages. But I get an error message that the page can not be found.

    I have programmed for my date Site a php file that reads and lists the Kisses. Anyone can send other users a kiss.

    add_action('bp_setup_nav', 'bp_profile_submenu_messages' );
    function bp_profile_submenu_messages() {
    	global $bp;
    	if(!is_user_logged_in()) return '';
    bp_core_new_subnav_item( array( 
    	'name' => 'Kisses',
    	'slug' => 'kisses', 
    	'parent_url' => $bp->loggedin_user->domain . $bp->bp_nav['messages']['slug'] . '/'; ,
    	'parent_slug' => $bp->bp_nav['messages']['slug'],
    	'position' => 10,
    	'screen_function' => 'kisses_posts'
    	) 
    ); 
    
    }
    
    function kisses_posts(){	
    	// a php-file (kisses.php) at members/single
    	bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/kisses' ) );
    }
    

    I would be really grateful if someone could help me of you.

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • @shanebp

    Moderator

    Try:

    function kisses_posts() {
        add_action( 'bp_template_content', 'kisses_screen' );
        bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function kisses_screen() { 
        locate_template( array( 'buddypress/members/single/kisses.php' ), true );
    }

    Or

    function kisses_screen() { 
       echo ' put the code from kisses.php here';
    }

    @emidio007

    Participant

    Hello shanebp,

    Thank you, It works very good.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Assigning New Subnav Items’ is closed to new replies.
Skip to toolbar