Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pagination links have same href [Resolved]


  • gsxrgeek
    Participant

    @gsxrgeek

    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)
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