Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Show avatars of my groups in member-header


  • javieregea
    Participant

    @javieregea

    Hello, I would like to show avatars users groups join in member-header.php, members-loop.php, and wall activity (entry.php). Only avatars. How can I do this? Thank you

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

  • javieregea
    Participant

    @javieregea

    @danbp Please, can anyone help? I need to show the avatars of the groups of users in the profile (member-header) Only avatars. Thank you


    danbp
    Participant

    @danbp

    You can use the loop which is in groups-loop.php.

    Try this and add some CSS class to your need to fit with your theme. code goes to bp-custom.php

    function my_groups_avatar_on_profile() {
    
    $user_id = bp_displayed_user_id();
    
    if ( bp_has_groups( 'type=alphabetical&user_id=' . $user_id ) ) : ?>
    
    <div style="clear:both;">
    	<ul>	
    		<?php while ( bp_groups() ) : bp_the_group(); ?>	
    
    			<li style="">
    				<div>
    					<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
    				</div>
    			</li>
    	
    		<?php endwhile; 
    endif; ?>
    
    	</ul>
    </div>
    <?php
    }
    add_action ( 'bp_after_member_header', 'my_groups_avatar_on_profile' );

    javieregea
    Participant

    @javieregea

    @danbp Perfect, you are the best !!
    Thank you!!


    danbp
    Participant

    @danbp

    You’re welcome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Show avatars of my groups in member-header’ is closed to new replies.
Skip to toolbar