Support » Plugin: BuddyPress Member Type Generator » New member types not showing in members directory

  • Hi, I have created “Students”, “Teachers”, “Coordinators”, “Directors”… like shown below:

    View post on imgur.com

    But only Students and “Group Leaders” (BuddyPress Role) filters appeared in the members directory, I don’t see the member types I created, image below:

    View post on imgur.com

    Although there are users who have the new member types assigned to them, but they are not showing up.

    I’m using LearnDash LMS and Thrive theme. Do you have any information why is this happening?

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor BuddyDev

    (@buddydev)

    Hi,
    I am sorry for the inconvenience.

    Are the assigned users active(visible in the directory)

    If not, It is probably because of that. Also, BuddyPress does not support listing member types directly into the directory. It is a theme dependent feature(listing of types as tab).

    The Has directory means that if you access yoursite.com/members/type/the-registered-type-name/ the users will be visible.

    Hope that helps.

    Regards
    Brajesh
    BuddyDev team

    • This reply was modified 2 years, 11 months ago by BuddyDev.

    Hi, thanks for the reply.

    Yes, users appear in the directory, every directory shows it’s own users correctly, but the filters are not showing in the main members directory.

    Thank you.

    Theme already have bp_members_directory_member_types action called in place also.

    http://thrive-demo.dunhakdis.me/

    Plugin Contributor BuddyDev

    (@buddydev)

    Hi,
    That action does not do anything on its own. Can you please ask the theme developer what code they are using to add the member types list to directory. Fo example, One of our BuddyPress focused theme(Community Builder), we add it to the list.

    The action is there to allow developers ad extra tabs without modifying the template. Please ask your theme developer about the code. That will help us understand the issue.

    Thank you
    Brajesh

    Hi, here is the members index template:

    <?php
    
    /**
     * Fires at the top of the members directory template file.
     *
     * @since BuddyPress (1.5.0)
     */
    do_action( 'bp_before_directory_members_page' ); ?>
    
    <div id="buddypress">
    
    	<?php
    
    	/**
    	 * Fires before the display of the members.
    	 *
    	 * @since BuddyPress (1.1.0)
    	 */
    	do_action( 'bp_before_directory_members' ); ?>
    
    	<?php
    
    	/**
    	 * Fires before the display of the members content.
    	 *
    	 * @since BuddyPress (1.1.0)
    	 */
    	do_action( 'bp_before_directory_members_content' ); ?>
    
    	<div id="members-dir-search" class="dir-search" role="search">
    
    		<?php bp_directory_members_search_form(); ?>
    		
    	</div><!-- #members-dir-search -->
    
    	<?php
    
    	/**
    	 * Fires before the display of the members list tabs.
    	 *
    	 * @since BuddyPress (1.8.0)
    	 */
    	do_action( 'bp_before_directory_members_tabs' ); ?>
    
    	<form action="" method="post" id="members-directory-form" class="dir-form">
    
    		<div class="item-list-tabs" role="navigation">
    			<ul>
    				<li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members <span>%s</span>', 'thrive' ), bp_get_total_member_count() ); ?></a></li>
    
    				<?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    					<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends <span>%s</span>', 'thrive' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
    				<?php endif; ?>
    
    				<?php
    
    				/**
    				 * Fires inside the members directory member types.
    				 *
    				 * @since BuddyPress (1.2.0)
    				 */
    				do_action( 'bp_members_directory_member_types' ); ?>
    
    			</ul>
    		</div><!-- .item-list-tabs -->
    
    		<div class="item-list-tabs" id="subnav" role="navigation">
    			<ul>
    				<?php
    
    				/**
    				 * Fires inside the members directory member sub-types.
    				 *
    				 * @since BuddyPress (1.5.0)
    				 */
    				do_action( 'bp_members_directory_member_sub_types' ); ?>
    
    				<li id="members-order-select" class="last filter">
    					<label for="members-order-by"><?php _e( 'Order By:', 'thrive' ); ?></label>
    					<select id="members-order-by">
    						<option value="active"><?php _e( 'Last Active', 'thrive' ); ?></option>
    						<option value="newest"><?php _e( 'Newest Registered', 'thrive' ); ?></option>
    
    						<?php if ( bp_is_active( 'xprofile' ) ) : ?>
    							<option value="alphabetical"><?php _e( 'Alphabetical', 'thrive' ); ?></option>
    						<?php endif; ?>
    
    						<?php
    
    						/**
    						 * Fires inside the members directory member order options.
    						 *
    						 * @since BuddyPress (1.2.0)
    						 */
    						do_action( 'bp_members_directory_order_options' ); ?>
    					</select>
    				</li>
    			</ul>
    		</div>
    
    		<div id="members-dir-list" class="members dir-list">
    			<?php bp_get_template_part( 'members/members-loop' ); ?>
    		</div><!-- #members-dir-list -->
    
    		<?php
    
    		/**
     		 * Fires and displays the members content.
     		 *
     		 * @since BuddyPress (1.1.0)
     		 */
    		do_action( 'bp_directory_members_content' ); ?>
    
    		<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
    
    		<?php
    
    		/**
    		 * Fires after the display of the members content.
    		 *
    		 * @since BuddyPress (1.1.0)
    		 */
    		do_action( 'bp_after_directory_members_content' ); ?>
    
    	</form><!-- #members-directory-form -->
    
    	<?php
    
    	/**
    	 * Fires after the display of the members.
    	 *
    	 * @since BuddyPress (1.1.0)
    	 */
    	do_action( 'bp_after_directory_members' ); ?>
    
    </div><!-- #buddypress -->
    
    <?php
    
    /**
     * Fires at the bottom of the members directory template file.
     *
     * @since BuddyPress (1.5.0)
     */
    do_action( 'bp_after_directory_members_page' );

    If it is not what you need, please tell me what do you need me to share.

    Thanks.

    Plugin Contributor BuddyDev

    (@buddydev)

    Thank you.
    Though it is the directory page, It does not contain the code for actual listing of the member type tabs.

    Can you please look into your theme and find the relevant code or ask your theme developer to do it?

    Thank you
    Brajesh

    Hi Brajesh, actually the theme developer has nothing to do with this, he is not hooking the action anywhere in his theme, but I found that I am using a plugin called “BuddyPress for LearnDash” and it is the responsible about that, after some search I found this:

    public function bp_learndash_register_member_types() {
                bp_register_member_type( 'student', array(
                    'labels' => array(
                        'name'          => __( 'Students', 'buddypress-learndash' ),
                        'singular_name' => __( 'Student', 'buddypress-learndash' ),
                    ),
                ) );
                bp_register_member_type( 'group_leader', array(
                    'labels' => array(
                        'name'          => __( 'Group Leaders', 'buddypress-learndash' ),
                        'singular_name' => __( 'Group Leader', 'buddypress-learndash' ),
                    ),
                ) );
            }
    
            public function bp_learndash_members_directory(){
                ?>
                <li id="members-group_leader"><a href="<?php site_url(); ?>bpe-group_leader"><?php printf( __( 'Group Leaders <span>%s</span>', 'buddypress-learndash' ), bp_learndash_members_count_by_type('group_leader') ); ?></a></li>
                <li id="members-student"><a href="<?php site_url(); ?>bpe-student"><?php printf( __( 'Students <span>%s</span>', 'buddypress-learndash' ), bp_learndash_members_count_by_type('student') ); ?></a></li>
            <?php
            }

    As you can see, the plugin add the types in a hard static way, it doesn’t load the member types dynamically.

    Do you think I can modify the code to do this? or I need to add the types manually?

    @buddydev noting your comment “It is a theme dependent feature(listing of types as tab).”
    what does a theme developer need to do to support this?

    I’ve tried a number of BuddyPress compatible themes without finding any theme with support for bp_members_directory_member_types

    Plugin Contributor BuddyDev

    (@buddydev)

    Hi Jonathan,
    A theme needs to list the member types as BuddyPress does not do it.

    You may find it in BuddyPress Community Builder theme or Kleo theme. These have it enabled.

    you can always add it on your own if you wish to(In members/index.php)

    Regards
    Brajesh
    BuddyDev team

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘New member types not showing in members directory’ is closed to new replies.