BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Gallery styling + lightbox (and comments)
Tagged: ACF, custom post type, gallery
- This topic has 14 replies, 3 contibutors, and was last updated 9 years, 2 months ago by Anonymous.
Question
July 25, 2015 at 4:37 am #43259@keenHi,
Does Boss have the capability of styling WP gallery images? I have a custom post type which allows the upload of a gallery of images (via ACF gallery field). When the images are displayed, it’s a standard WP Gallery (pretty ugly, and not in keeping with Boss styling). Additionally, when the images are clicked on, it would be great if they opened using the Boss lightbox.
Is this possible?
Many thanks
Answers
July 26, 2015 at 1:50 pm #43321@alyssa-buddyboss
AlyssaParticipant@keen the script we are using should do that by default. But for some reason the action is not firing. Let me get Varun on this for you.
July 27, 2015 at 10:20 am #43364@keenOk – will Varun reply here?
Should BuddyBoss handle the gallery AND open them in the lightbox, or just the lightbox effect?
July 28, 2015 at 1:23 pm #43457@alyssa-buddyboss
AlyssaParticipant@keen he should reply here, and it will only handle the lightbox
August 3, 2015 at 3:14 am #43826@
AnonymousHi @keen, I am working on it to bundle it as function
jQuery(".gallery .gallery-item .gallery-icon").addClass("buddyboss-media-photo"); jQuery(".gallery .gallery-item .gallery-icon a").addClass("buddyboss-media-photo-wrap");
I will post the function within few hours.
Regards
August 3, 2015 at 7:11 am #43842@
AnonymousHi @keen , you can include it inside your child theme folder functions.php
add_action('wp_head', 'add_custom_gallery_class'); function add_custom_gallery_class() { $script= '<script type="text/javascript">'; $script.='$(".gallery .gallery-item .gallery-icon a").each(function(i) { $(this).attr("id", "media-" + i); }); function add_gallery_class() {'; $script.='jQuery(".gallery .gallery-item .gallery-icon").addClass("bbmedia-grid-item"); jQuery(".gallery .gallery-item .gallery-icon a").addClass("buddyboss-media-photo-wrap"); jQuery(".gallery .gallery-item .gallery-icon a img").addClass("buddyboss-media-photo"); '; $script.='} //window.onload = add_gallery_class; jQuery(document).ready(function(){add_gallery_class();});'; $script.='</script>'; echo $script; }
Above codes works only with BuddyBoss Media plugin is active ,nothing related to Boss theme
Regards
Varun DubeyAugust 3, 2015 at 7:22 am #43844@keenHi Varun,
Thanks for this. I’ve added the code to my functions file and it hasn’t changed anything. Do you have an example of how it should be behaving?
Many thanks,
LorraineAugust 22, 2015 at 11:06 am #44902@keenHi,
It’s been almost 3 weeks since I responded saying that the code provided had not taken any effect.
Please can you advise on how to fix this issue?
Many thanks.
August 23, 2015 at 12:57 am #44935@
AnonymousHi @keen,
It’s not any issue. Please add those codes to child theme function.php and when you create gallery link media to file not to the attachment url.
Regards
Varun DubeyAugust 23, 2015 at 1:00 am #44936@
AnonymousAbove codes will only WordPress default gallery , if you are using any third party codes to create the gallery those gallery class and structure will not be predefined. You can check the codes we are modifying the existing set of deep classes and modifying it with new.
RegardsAugust 23, 2015 at 4:51 am #44944@keenHi Varun,
I have created a standard gallery to test this out and it seems to be working ok, but the images are very dark as if they have an overlay.
Also, if I click comment or like, it closes the lightbox down.
I don’t have a plugin installed to handle media apart from Buddyboss Media.
Any ideas on what could be causing that?
Thanks.
August 23, 2015 at 10:46 am #44966@
AnonymousHi @keen we have not created any comment section for post gallery images and it will be typical to implement, each gallery image is not part of BB media where we can post comment.
August 23, 2015 at 10:47 am #44967@
Anonymousmy personal suggestion for gallery images with comments, you can take a look of this plugin
http://codecanyon.net/item/social-gallery-wordpress-photo-viewer-plugin/2665332
RegardsAugust 31, 2015 at 6:28 am #45438@keenHi Varun,
I’ve made do with another plugin and removed the code.
I will wait for you to improve how images are handled as I know there are other users requesting the same features as I have in the past. I don’t want Facebook comments to be used on the site and have discounted the suggested plugin previously, however this style of lightbox with comments is exactly what I’m after.
You can close this ticket down.
Thanks.
August 31, 2015 at 8:26 am #45449@
AnonymousThanks @keen, We are working on media plugin to improve it.
- The question ‘Gallery styling + lightbox (and comments)’ is closed to new replies.