How to have two galleries side by side?
Assign each of those 2 galleries a div and in the css add:- .gallery-1 { width: 48%; float: left; } .gallery-2 { width: 48%; float: left; position:relative; }
Assign each of those 2 galleries a div and in the css add:- .gallery-1 { width: 48%; float: left; } .gallery-2 { width: 48%; float: left; position:relative; }
The problem is that the gallery doesn’t exist when colorbox binds itself to the gallery links. I was able to fix this problem by using the ajaxComplete() event, like so: $(document).ajaxComplete(function(){ $(‘.gallery-icon a’).colorbox(); }); Thanks @Milo for pointing me in the right direction.
Open to anybody who can simplify this but here’s what I came up with that worked for me. First thing’s first – get the gallery, using get_post_gallery(), as soon as the loop starts: <?php if( have_posts() ) : ?> <?php while( have_posts() ) : the_post(); $gallery = get_post_gallery(); $content = strip_shortcode_gallery( get_the_content() ); ?> <div … Read more
Ok, so, I found this function, but it wasn’t in the codex. It came from Pippin’s Plugins, just to clarify for any future readers. It appears this function was used as a filter added onto the content, and will only run when filtering existing content, because it’s retrieving & replacing the galleries placed inside the … Read more
Found the issue. The fancybox library now uses data-fancybox instead of rel to identify stuff, so I just updated the syntax.
I will suggest using custom fields for it. List of good ones: https://www.advancedcustomfields.com/ https://carbonfields.net/docs/ Those custom fields provide you with an option to create a select field and you can display the gallery depending on a type chosen. Please let me know if you need further information.
Technically “off topic” here as your actual question is open-ended and there is lots of room for opinion. https://wordpress.stackexchange.com/help/dont-ask Sidebars and widgets are a perfect way to organize these elements. Keep in mind these are simply tools to organize blocks for repeated use in various locations. So, officially, my answers to your two questions are: … Read more
I don’t like how WordPress processes the gallery shortcode. This is some slightly modified code I had that I’ve used to get the images in a gallery. In this example, the attachments (and thus their IDs) would only be available after the gallery shortcode has been processed. If you’re looking to display different HTML than … Read more
Custom gallery displayin and sorting error
How to generate customized filtered output for the gallery