Skip to:
Content
Pages
Categories
Search
Top
Bottom

adding member directory to a tab


  • mmoore5553
    Participant

    @mmoore5553

    I am wanting to add the members directory under the profile and click it and it shows all members under that persons profile. Exactly like activity and settings with the options below. What i have done so far since the member directory code is already there i created a allmembers.php file and moved it to the members/single folder. Then created a folder called members and stuck in the members-loop.php. I then added this line in the home.php in the single folder.

    locate_template( array( ‘members/single/allmembers.php’ ), true );

    I am unsure if this is the correct way to add a tab and function. I am trying to add the tab via the bp-custom.php but i am hung up on the syntax.

    Can anyone help point me in the right direction. All the tutorials i find are outdated on adding tabs and this type of functionality.

    I am using latest wordpress and buddypress 1.9

    Or am i going about this all wrong and there is a slug for member profile that i can use ?

Viewing 1 replies (of 1 total)

  • mmoore5553
    Participant

    @mmoore5553

    This is what i have in my bp-custom.php

    add_action('bp_setup_nav', 'mb_bp_profile_menu_posts', 301 );
    function mb_bp_profile_menu_posts() {
    global $bp;
    bp_core_new_nav_item(
    	array(
            'name' => 'All Members',
            'slug' => 'allmembers',
            'position' => 60, 
            //'default_subnav_slug' => 'published', // We add this submenu item below 
            'screen_function' => 'my_posts_screen_link'
    	)
    );
    function my_posts_screen_link() {
        add_action( 'bp_template_title', 'my_posts_screen_title' );
        add_action( 'bp_template_content', 'my_posts_screen_content' );
        bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function my_posts_screen_title() {
        echo 'All Members';
    }
    
    function my_posts_screen_content() {
        get_template_part( 'members/single/allmembers.php' );
        //or you can put code here; only useful for short bits or echoing plain text
    }
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘adding member directory to a tab’ is closed to new replies.
Skip to toolbar