Jump to content

[Share] Combine 2 Gallery Sections

Recommended Posts

Posted

You can use these steps to combine 2 Gallery Sections. With this way, you can split gallery into 2 sections with different columns/ratios.

If code doesn't work, you can send link to page where you use Gallery Section, I will check again.

#1. First, find ID of 2 Gallery Sections.

In my example, we will have:

Gallery with 3 columns

section[data-section-id="6707a04e0b698b4fb4bd8f3e"]

image.png.2d15ea8137c701771a8c455ed38f8f29.png

Gallery with 4 columns

section[data-section-id="66ed2c3e2f063471736e09c1"]

image.png.72186f1a2c5457c1257a08ea0885979c.png

#2. Use this code to Page Header Injection (or Code Injection > Footer)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
             $('section[data-section-id="66ed2c3e2f063471736e09c1"] .gallery-grid-wrapper').insertAfter('section[data-section-id="6707a04e0b698b4fb4bd8f3e"] .gallery-grid-wrapper');
});
</script>
<style>
section[data-section-id="6707a04e0b698b4fb4bd8f3e"] .gallery-grid-wrapper {
    margin-bottom: 1.75vw;
}
</style>

image.png.cb667607038d0d96f05a7cfc3c4d6646.png

#3. Result

image.png.19f0c6d59b84d9bbd7ce3bec267bb66d.png

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 4 weeks later...
  • Replies 4
  • Views 443
  • Created
  • Last Reply

Top Posters In This Topic

Posted
18 hours ago, parisianfoodphotographer said:

Currently it shows 3 landscape photos in a row, I'd like for it to only show two.

If you change the number of columns of items in the middle of the gallery, you will need to recode the layout of all items from there down.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.