Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to display specific user\\\'s avatar?


m@rk
Participant

@mrk-1

Thank you Lisa, that rocks.

So if you want to have an author widget in a user’s blog sidebar, here’s an approach:

<?php
$userid = 2; // set user_id
$bp_status = get_usermeta( $userid, 'bp_status' ); // get_usermeta(userid,'metakey');
if( $bp_status['content'] && is_home() ){ // if there is a status set && we are on blog's home
?>
<!-- Status Updates -->
<li>
<div class="sidebarbox">
<h2>Autor</h2>
<ul>
<span class="alignleft">
<a href="<?php echo bp_core_get_userurl( $userid ) ?>"
title="Profil von <?php echo bp_core_get_user_displayname( $userid, true ) ?>">
<?php echo bp_core_get_avatar( $userid, 1 ) ?></a>
</span>
<?php echo $bp_status['content']; ?>
<span style="display: block; clear: both;"><!-- clear --></span>
</ul>
</div>
</li>
<?php } // endif ?>

Am I really the first one who thought about this?

A “cleaner” way would be highly welcome.

Skip to toolbar