Skip to:
Content
Pages
Categories
Search
Top
Bottom

Member Page Tabs


  • joeyaberle
    Participant

    @joeyaberle

    Is there anyway to create a new tab that would go on the members page? I want to have a tab that will show featured members, such as admin.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

  • danbp
    Moderator

    @danbp

    hi @joeyaberle,

    you have 2 options: 1) hardcoding the template file or 2) add the tab with a function to a placeholder.

    1) make a copy of buddypress/bp-templates/bp-legacy/buddypress/members/index.php and add it into your child-theme (see codex on how to do that) and add the html you want at line 24, after the endif;

    2) this function will add My Tab on the members directory nav bar, beside All members | My Friends | My Tab. Add it into your theme’s functions.php or bp-custom.php

    function bpfr_my_directory_setup_nav() {
    	echo'<li><a href="http://example.com/wp-content/themes/mychild/my_extra_page.php">My Tab</a></li>'; // link to what you want
    }
    add_action( 'bp_members_directory_member_types', 'bpfr_my_directory_setup_nav' );

    my_extra_page.php is a file that doesn’t exist. You have to create it first. This file should content at least:

    <div id="buddypress">
    <div id="members-dir-list" class="members dir-list">
    			<?php your stuff here....  ?>
    		</div><!-- #members-dir-list -->
    </div><!-- #buddypress -->

    Placeholder reference:
    buddypress/bp-templates/bp-legacy/buddypress/members/index.php:25
    More on the Codex:
    https://codex.buddypress.org/component/members/


    joeyaberle
    Participant

    @joeyaberle

    Thanks so much for this, I will be sure to report back if it worked or not!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Member Page Tabs’ is closed to new replies.
Skip to toolbar