-
Author
-
July 29, 2015 at 19:56 #70597
ianll
ParticipantHello,
I’m trying to change the member-loop so I can render the member avatar image as a background image. Below is the code I’m trying and have tried so many different codes to no avail. The image url slashes keep getting stripped out or the <img src html is rendered which wont work.Any suggestions to the code?
COPY CODE<?php while ( bp_members() ) : bp_the_member(); ?> <div class="item-avatar" style="background: url("<?php $userid = bp_get_member_user_id(); $avatarurl = bp_core_fetch_avatar(array('item_id' => $userid, 'type' => 'full', 'html' =>false)); echo $avatarurl;?>") center center no-repeat">Thank you!!
July 29, 2015 at 21:56 #70615sharmstr
ModeratorWouldnt the returning just the url be better? bp_core_fetch_avatar_url
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 29, 2015 at 22:03 #70616ianll
Participanttried that as well and still get the slashes stripped out…
July 29, 2015 at 22:34 #70622sharmstr
ModeratorThis works for me
COPY CODEstyle="background-image:url(<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'html' => false, 'type' => 'full' ) ); ?>); background-size:cover;"Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.

