Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add a new tab under Friends?


  • firestriker16
    Participant

    @firestriker16

    Using Buddy Press, Version 2.2.1

    Simple, yet could not get a proper solution still. I want to add a Category tab to categorize the friends like “Family, Close Frinends, Ex-Friends” etc.

    Here is my solution I have from the community:

    
    add_action( 'bp_setup_nav', 'add_categoreies_subnav_tab', 100 );
     
    			function add_categoreies_subnav_tab() {
    				global $bp;
     
    				bp_core_new_subnav_item( array(
    					'name' => 'Categories',
    					'slug' => 'categories',
    					'parent_url'      => $bp->loggedin_user->domain . 'friends/',
    					'parent_slug'     => $bp->friends->slug,
    					'screen_function' => 'friend_categories',
    					'action'=>'categories',
    					'position' => 50
    					)
    				);
    			}
    			 
    			// redirect to categories page when 'Categories' tab is clicked
    			// assumes that the slug for your Categories page is 'categories' 
    			function friend_categories() {
    				
    				
    				add_action( 'bp_template_content', 'show_friend_categories' );
    				 bp_core_load_template( apply_filters('bp_core_template_plugin',  'members/single/friends/categories' ));
    			// }
    			 }

    what happens here, it sets the navigation item correct, but categories.php loads in an entire new page, not revelant to anything with theme. How can I locate my categories.php just inside friends tab, like requests does in default ?

    Please help me keep going,

    Thank you..

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to add a new tab under Friends?’ is closed to new replies.
Skip to toolbar