Skip to:
Content
Pages
Categories
Search
Top
Bottom

Navigation not working on tab page


  • xbladerunner
    Participant

    @xbladerunner

    Hello. I created a group directory tab in the groups area of my buddypress theme, and it seems to work fine minus the page tab navigation (e.g., there are over 25 groups, and 20 or so displayed per page, but when you click to tab through the pages it is nonresponsive).

    Before I figured out how to create a buddypress page from a tab, I just created a link to the wordpress group directory page– and the navigation tabs work fine there, just not on my buddypress page, so I’m sure the problem is with my coding.

    Have you seen this before? Can you help out?

    function group_tab_yourtabname() {
          global $bp;
     	  $parent_slug = 'groups';
     	  
          bp_core_new_subnav_item( array( 
                'name' => 'Advisory Group Directory', 
                'slug' => 'directory', 
                'screen_function' => 'mydirectory_screen', 
                'position' => 40,
                'parent_url'      => bp_loggedin_user_domain() . $parent_slug.'/',
                'parent_slug'     => $parent_slug,
                
          ) );
    }
    add_action( 'bp_setup_nav', 'group_tab_yourtabname' );
     
     
    function mydirectory_screen() {
        
        // Add title and content here - last is to call the members plugin.php template.
        add_action( 'bp_template_title', 'yourtab_title' );
        add_action( 'bp_template_content', 'yourtab_content' );
        bp_core_load_template( 'buddypress/members/single/plugins' );
    }
    function yourtab_title() {
        echo '<center>Advisory Group Directory</center>';
    }
    
    function yourtab_content() { 
        echo 'United Resource Connection uses Advisory Groups as quality assurance judiciary boards. If your field of study and expertise aligns with one or more Advisory Group you are interested in joining, request membership by using the <i>Request Membership</i> buttons on the right.  ';
    do_action( 'bp_before_groups_loop' ); ?>
    
    <?php if ( bp_get_current_group_directory_type() ) : ?>
    	<p class="current-group-type"><?php bp_current_group_directory_type_message() ?></p>
    <?php endif; ?>
    
    <?php if ( bp_has_groups( 'user_id=NULL'  ) ) : ?>
    
    	<div id="pag-top" class="pagination">
    
    		<div class="pag-count" id="group-dir-count-top">
    
    			<?php bp_groups_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links" id="group-dir-pag-top">
    
    			<?php bp_groups_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    	<?php
    
    	/**
    	 * Fires before the listing of the groups list.
    	 *
    	 * @since 1.1.0
    	 */
    	do_action( 'bp_before_directory_groups_list' ); ?>
    
    	<ul id="groups-list" class="item-list" aria-live="assertive" aria-atomic="true" aria-relevant="all">
    
    	<?php while ( bp_groups() ) : bp_the_group(); ?>
    
    		<li <?php bp_group_class(); ?>>
    			<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
    				<div class="item-avatar">
    					<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
    				</div>
    			<?php endif; ?>
    
    			<div class="item">
    				<div class="item-title"><?php bp_group_link(); ?></div>
    				<div class="item-meta">
    					<span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
    						<?php
    						/* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    						printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
    						?>
    					</span>
    				</div>
    
    				<div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
    
    				<?php
    
    				/**
    				 * Fires inside the listing of an individual group listing item.
    				 *
    				 * @since 1.1.0
    				 */
    				do_action( 'bp_directory_groups_item' ); ?>
    
    			</div>
    
    			<div class="action">
    
    				<?php
    
    				/**
    				 * Fires inside the action section of an individual group listing item.
    				 *
    				 * @since 1.1.0
    				 */
    				do_action( 'bp_directory_groups_actions' ); ?>
    
    				<div class="meta">
    
    					<?php bp_group_type(); ?> / <?php bp_group_member_count(); ?>
    
    				</div>
    
    			</div>
    
    			<div class="clear"></div>
    		</li>
    
    	<?php endwhile; ?>
    
    	</ul>
    
    	<?php
    
    	/**
    	 * Fires after the listing of the groups list.
    	 *
    	 * @since 1.1.0
    	 */
    	do_action( 'bp_after_directory_groups_list' ); ?>
    
    	<div id="pag-bottom" class="pagination">
    
    		<div class="pag-count" id="group-dir-count-bottom">
    
    			<?php bp_groups_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links" id="group-dir-pag-bottom">
    
    			<?php bp_groups_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    <?php else: ?>
    
    	<div id="message" class="info">
    		<p><?php _e( 'There were no groups found.', 'buddypress' ); ?></p>
    	</div>
    
    <?php endif; ?>
    
    <?php
    
    /**
     * Fires after the display of groups from the groups loop.
     *
     * @since 1.2.0
     */
    do_action( 'bp_after_groups_loop' );
    } 
  • You must be logged in to reply to this topic.
Skip to toolbar