set size for cover image when used in members loop
-
I’ve setup cover images to display in the member loops, similar to this:
//cover image inside members loop <?php if (bp_has_members($args)) : ?> <?php while (bp_members()) : bp_the_member();?> <?php // Get the Cover Image $member_cover_image_url = bp_attachments_get_attachment('url', array( 'object_dir' => 'members', 'item_id' => bp_get_member_id(), )); ?> <img src="<?php echo $member_cover_image_url; ?>"> <div class="item-avatar"> <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_avatar('height=70&width=70'); ?> </a> </div> <!--etc......--> <?php endwhile; ?> <?php endif; ?>
Is there a way to change the size of them when they display in the members loop? I know you can do it by CSS, but doing it by CSS still loads the full images – my cover images are a large 1500px by 500px, so it will be loading 20 large images at a time in the members loop.
Is there something like this I can use:
$member_cover_image_url = bp_attachments_get_attachment('url', array( 'object_dir' => 'members', 'item_id' => bp_get_member_id(), 'width' => 300px, 'height' => 100px, ));
Any help appreciated.
- The topic ‘set size for cover image when used in members loop’ is closed to new replies.