BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Blur half of "bb-cover-photo"
- This topic has 5 replies, 2 contibutors, and was last updated 9 years, 4 months ago by Alyssa.
Question
July 20, 2015 at 5:49 am #43033@snikayHi,
I’m trying to blur half/part of the “bb-cover-photo” (BuddyPress User background image).
So idea wise like this: http://jsfiddle.net/Lmccn0vw/2/In member-header.php my code is this:
[...] <?php do_action( 'bp_before_member_header' ); ?> <?php //output cover photo. echo buddyboss_cover_photo("user",bp_displayed_user_id()); ?> <div class="outerblur"> <div class="testblur"> <?php //output cover photo. echo buddyboss_cover_photo("user",bp_displayed_user_id()); ?> </div> </div> <div id="item-header-cover" class="table"> [...]
The CSS like this (already messed up by playing around):
.outerblur { float: right; width: 400px; } .testblur .bb-cover-photo { overflow: hidden; } .testblur .bb-cover-photo div.holder { background-position: center right !important; -webkit-filter: blur(5px); -moz-filter: blur(5px); -o-filter: blur(5px); -ms-filter: blur(5px); filter: blur(5px); filter: blur(5px); height: 100%; right: 2px; float: right; position: absolute; }
My problem is, that the blured background won’t align to “
background-position: center right;
“. It stays aligned to “center left”.Also
echo buddyboss_cover_photo("user",bp_displayed_user_id());
Causes that I now have two “Update Cover Photo”-icons/buttons. Do I just have to echo another “shortcode” for the cover photo?Any ideas?
Thanks!Answers
July 20, 2015 at 8:30 am #43044@alyssa-buddyboss
AlyssaParticipant@snikay this is custom development so I can’t support this but I can help you with the BuddyBoss function. Instead of calling the cover photo again use this code:
$cover_photo = buddyboss_cover_photo_get("user",bp_displayed_user_id()); $actual_photo = wp_get_attachment_image_src($cover_photo["attachment"],"full"); echo $actual_photo[0];
You could also try this for background-position:
background-position-x: 100%; background-position-y: 50%;
July 20, 2015 at 9:21 am #43052@snikayThanks TJ! So, now my code looks like this:
<div class="outerblur"> <div class="testblur"> <?php //output cover photo without upload button $cover_photo = buddyboss_cover_photo_get($object,$object_id); $actual_photo = wp_get_attachment_image_src($cover_photo["attachment"],"full"); echo $actual_photo[0]; ?> </div> </div>
But I can’t see any image placed into the code (see screenshot of firefox developer info):
July 21, 2015 at 7:25 pm #43116@alyssa-buddyboss
AlyssaParticipant@snikay I thought you would replace object and object_id, I corrected the code above.
July 22, 2015 at 9:46 am #43137@snikayAh, thanks – works! 🙂
July 22, 2015 at 6:55 pm #43155@alyssa-buddyboss
AlyssaParticipantGreat news!
- The question ‘Blur half of "bb-cover-photo"’ is closed to new replies.