Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pagination links have same href [Resolved]

  • @gsxrgeek

    Participant

    I created my own custom members page (code below). When you click on the pagination the first time the href’s are correct, but when you try to go to another page in the pagination it has the same href as the page you are currently on.

    bp_members_pagination_links();

    First time clicking pagination the href’s are correct.
    ?upage=2 , ?upage=3, ?upage=4 etc.

    Second time clicking the pagination all the href’s are the same, say you are on page two. All the href’s will be ?upage=2 , ?upage=2, ?upage=2 etc.

    Thanks for the help!

    
    <?php do_action( 'bp_before_directory_members_page' ); ?>
    <div id="buddypress">
    	<?php do_action( 'bp_before_directory_members' ); ?>
    	<?php do_action( 'bp_before_directory_members_content' ); ?>
    	<div id="members-dir-search" class="dir-search" role="search">
        <p>Search by name or department.</p>
    		<?php bp_directory_members_search_form(); ?>
    	</div><!-- #members-dir-search -->
    		<div id="members-dir-list" class="members dir-list">
    <?php do_action( 'bp_before_members_loop' ); ?>
    <?php //if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : 
    if ( bp_has_members( 'type=alphabetical' ) ) : 
    ?>
       <div id="pag-top" class="pagination">
         <div class="pag-count" id="member-dir-count-top">
           <?php bp_members_pagination_count(); ?>
        </div>
        <div class="pagination-links" id="member-dir-pag-top">
           <?php bp_members_pagination_links(); ?>
        </div>
       </div>
       <?php do_action( 'bp_before_directory_members_list' ); ?>
       <ul id="members-list" class="item-list" role="main">
       <?php while ( bp_members() ) : bp_the_member(); ?>
        <li>
          <div class="item-avatar">
             <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
          </div> 
          <div class="item">
           <?php do_action( 'bp_directory_members_item' ); ?>
           <a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?>
           </a>
           <span><?php bp_member_profile_data( 'field=Department', bp_get_member_user_id() ); ?></span>
           <span><?php bp_member_profile_data( 'field=Job Title', bp_get_member_user_id() ); ?></span>
           </div>
           <div class="action">
               <?php do_action( 'bp_directory_members_actions' ); ?>
          </div>
          <div class="clear"></div>
       </li>
     <?php endwhile; ?>
     </ul>
     <?php do_action( 'bp_after_directory_members_list' ); ?>
     <div id="pag-bottom" class="pagination">
        <div class="pag-count" id="member-dir-count-bottom">
           <?php bp_members_pagination_count(); ?>
        </div>
        <div class="pagination-links" id="member-dir-pag-bottom">
          <?php bp_members_pagination_links(); ?>
        </div>
      </div>
    <?php else: ?>
       <div id="message" class="info">
          <p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
       </div>
    <?php endif; ?>
    <?php do_action( 'bp_after_members_loop' ); ?>
    </div><!-- #members-dir-list -->
    		<?php do_action( 'bp_directory_members_content' ); ?>
    		<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
    		<?php do_action( 'bp_after_directory_members_content' ); ?>
    	<?php do_action( 'bp_after_directory_members' ); ?>
    </div><!-- #buddypress -->
    <?php do_action( 'bp_after_directory_members_page' ); ?>
    
Viewing 7 replies - 1 through 7 (of 7 total)
  • @r-a-y

    Keymaster

    What version of BuddyPress are you using? This should be fixed in 2.2.0.

    @hnla

    Participant

    @r-a-y no there appears to still be some issue, @danbp flagged on a ticket and I can see the same issue on a current trunk install, but haven’t had time to delve further , may not be a BP issue though!

    @r-a-y

    Keymaster

    The issue that the OP is referring to is member pagination.

    I can confirm that this is fixed in BP 2.2.0.

    danbp’s issue is related to pagination on notification pages:
    https://buddypress.trac.wordpress.org/ticket/6205

    @hnla

    Participant

    @r-a-y ok well my bad although from recent experience having to work through BP pagination it all seems to originate from same process or WP source and the OP’s issue does sound very similar – not a fun little bit of BP at all!

    @gsxrgeek

    Participant

    I am using Version 2.1.1.

    @gsxrgeek

    Participant

    I updated to 2.2.0 and the issue seems to be resolved. Thanks everyone!

    @hnla

    Participant

    Glad to hear issue resolved then, the concerns with notifications are another matter so we’ll close this ticket as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pagination links have same href [Resolved]’ is closed to new replies.
Skip to toolbar