Skip to:
Content
Pages
Categories
Search
Top
Bottom

Trouble with Members Loop


  • Marcella
    Participant

    @marcella1981

    I have this

    
    <?php if(bp_has_members('type=active')) : ?>					
    					<?php while(bp_members()) : bp_the_member(); ?>
    						<li>
    							<div class="thumb">
    								<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=75&height=75'); ?></a>
    							</div>
    							<div class="details">
    								<h4><a href="<?php bp_member_permalink(); ?>">@<?php bp_member_name(); ?></a></h4>								
    								<p class="view-profile"><a href="<?php bp_member_permalink(); ?>">View Profile</a></p>
    							</div>
    						</li>
    					<?php endwhile; ?>	
    				<?php else: ?>
    					<li class="message info">No members found.</li>
    				<?php endif; ?>
    

    and

    
    <?php if(bp_has_members('type=popular')) : ?>					
    					<?php while(bp_members()) : bp_the_member(); ?>
    						<li>
    							<div class="thumb">
    								<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=75&height=75'); ?></a>
    							</div>
    							<div class="details">
    								<h4><a href="<?php bp_member_permalink(); ?>">@<?php bp_member_name(); ?></a></h4>								
    								<p class="view-profile"><a href="<?php bp_member_permalink(); ?>">View Profile</a></p>
    							</div>
    						</li>
    					<?php endwhile; ?>	
    				<?php else: ?>
    					<li class="message info">No members found.</li>
    				<?php endif; ?>
    

    and

    
    <?php if(bp_has_members('type=online')) : ?>					
    					<?php while(bp_members()) : bp_the_member(); ?>
    						<li>
    							<div class="thumb">
    								<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=75&height=75'); ?></a>
    							</div>
    							<div class="details">
    								<h4><a href="<?php bp_member_permalink(); ?>">@<?php bp_member_name(); ?></a></h4>								
    								<p class="view-profile"><a href="<?php bp_member_permalink(); ?>">View Profile</a></p>
    							</div>
    						</li>
    					<?php endwhile; ?>	
    				<?php else: ?>
    					<li class="message info">No members found.</li>
    				<?php endif; ?>
    

    All loops return nothing.

    Am I doing something wrong or what could be happening here? There are members in the site…

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

  • danbp
    Moderator

    @danbp

    Where do you use this code ?

    Read here and see especially the recommendation at the end of the post:

    Members Loop


    or view more here:

    Add custom filters to loops and enjoy them within your plugin


    Marcella
    Participant

    @marcella1981

    Its ysed in a custom page tempkate in a sidebar.

    Ive looked at those docs and cant see anything im doing wrong nor how to debug.


    shanebp
    Moderator

    @shanebp

    Is your sidebar in a BuddyPress page ?

    Take a look at the BP_Core_Members_Widget


    Marcella
    Participant

    @marcella1981

    Hey. Its just a custom page template for the home page.

    Its weird it will work if I pass the parameter of type as an empty variable and default to active but wont output anything if its set to newest or online for example.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trouble with Members Loop’ is closed to new replies.
Skip to toolbar