How to Create a Responsive Photo Gallery in WordPress (No Code Needed)

Mehraz Morshed Avatar
10–15 minutes

A good photo gallery in WordPress should look great on every screen, load fast, and take minutes to build. Sadly, many site owners get only one of those three.

In this guide, you will build a responsive photo gallery step by step, right inside the WordPress block editor. You will not need any code. By the end, your gallery will adapt to desktop, tablet, and mobile, open photos in a clean lightbox, and load quickly even with lots of images.

We will use the free ShapedGallery block from ShapedPlugin. However, the tips on layouts, alt text, and mobile settings will help you no matter which tool you use.

Before You Start: What You Need

You only need three things to follow along:

  • A WordPress site running version 6.8 or later, with PHP 8.1 or later
  • The ShapedGallery plugin, which is free
  • A folder of photos you want to show

Prepare Your Photos First

A few minutes of prep makes a big difference later. First, give your files clear names, such as red-rose-bouquet.jpg instead of IMG_4821.jpg. Next, shrink very large camera files before you upload them, because visitors do not need a 6,000-pixel image to view a gallery. Finally, jot down a short description for each photo. You will use it as alt text in Step 3.

Install ShapedGallery

  • In your WordPress dashboard, go to Plugins → Add New Plugin.
  • Type ShapedGallery in the search box.
  • Click Install Now, then click Activate.

After activation, you will see a new ShapedGallery menu in your dashboard. You do not need to configure anything there yet. Everything in this guide happens inside the block editor.

Step 1: Add the ShapedGallery Block

Open the page or post where you want the gallery. Then click the + button to open the block inserter and type ShapedGallery. You can also type “gallery,” “masonry,” or “justified,” and the block will still show up.

Click the block to add it. Right away, ShapedGallery shows you a layout picker instead of an empty box.

Prefer a ready-made design? Click the Ready Patterns Library button in the editor’s top toolbar instead. Pick a pattern you like, click Insert, and then swap in your own photos. It is the fastest way to get a polished look.

Step 2: Choose a Layout That Fits Your Photos

The layout picker asks you to choose a layout to start building your gallery. You will see three options:

Layout

How it looks

Best for

Auto. Justified

Rows of equal height; every photo keeps its original shape

Photographers, travel shots, and mixed portrait and landscape photos

Grid

Equal square tiles in neat columns; photos get cropped to fit

Products, team photos, and shots with the same shape

Masonry

Pinterest-style columns with different heights

Mood boards, interiors, food, and lifestyle photos

Select the layout you want and click Apply Layout. Don’t worry about choosing wrong. You can switch layouts later with the Change Layout button in the block toolbar, and your photos stay in place.

Step 3: Add Your Photos and Alt Text

As soon as you apply a layout, the media window opens. On the left, under Add media from, keep Images selected.

Now you have two choices:

  • Upload Files: Drag your photos into the window or click Select Files.
  • Media Library: Pick photos you already uploaded. You can search by name or filter by date.

Select all the photos you want, then click Create a New Gallery. Your gallery appears in the editor right away, styled with the layout you chose.

Add Alt Text While You Are Here

Alt text describes a photo for people who use screen readers. It also helps search engines understand your images. Yet the WebAIM Million 2026 report found missing alt text on 53.1% of the top one million home pages, so many sites skip this step. Don’t let yours be one of them.

To add it, click Edit Gallery in the block toolbar and then click a photo. In the Attachment Details panel, fill in the Alt Text field. Keep it short and specific, for example, “Pink peony and white rose bouquet in a glass vase.”

The same panel also lets you edit the Title, Caption, and Description. Fill these in if you plan to show text under your photos in Step 5.

Put Your Photos in the Right Order

Inside Edit Gallery, drag and drop photos to reorder them. Place your strongest photo first, because it sets the first impression. If you want to flip the whole order, use Reverse Order. When you finish, click Update Gallery.

Step 4: Make the Gallery Responsive on Every Device

Click your gallery, then open the block settings sidebar on the right. The Layout Settings panel sits at the top.

Most layout options here are responsive. In other words, you can set a different value for desktop, tablet, and mobile using the device switcher next to each control.

For Grid and Masonry layouts, set the Columns for each device. A good starting point looks like this:

Device

Columns

Why

Desktop

4

Plenty of space for a full, rich view

Tablet

3

Photos stay large enough to enjoy

Mobile

2

Each photo stays clear on a small screen

For the Auto. Justified layout, you work with row height instead of columns. Leave Maximum Row Height on Auto, or switch it to Custom and set your own Row Height (px).

Next, adjust the Horizontal Gap and Vertical Gap. Both start at 15px. Smaller gaps feel modern and tight, while larger gaps give each photo more breathing room. On mobile, a slightly smaller gap often looks better.

Handy tip: Want a lighter gallery on phones? Open Advanced Settings and turn on Hide on Mobile Portrait or Hide on Mobile Landscape. Then add a second, shorter gallery and hide that one on desktop. The editor shows a small “Hidden on” note, so you always know which gallery shows where.

Step 5: Style Your Photos and Captions

Now make the gallery match your brand. Open Image & Video Settings first.

  • Resolution: Choose the image size the gallery uses: Thumbnail, Medium, Large, or Full. For most galleries, Large gives a sharp result without heavy files.
  • Image Border and Border Radius: Add a thin border or round the corners. A radius of 6 to 10px gives a soft, friendly look.
  • Normal and Hover styles: Set a different border, radius, or shadow for when visitors hover over a photo. This small touch makes the gallery feel interactive. Photos also zoom in slightly on hover.
  • Image Preloader: Turn this on to show a placeholder while photos load.

After that, open Content Settings if you want text with your photos.

  • Turn on Image Title and pick its source: Attachment Title or Attachment Caption.
  • Choose an HTML Tag for the title. For gallery titles, H3 or Span usually fits best, since your page already has its own main headings.
  • Turn on Image Description if you want a short line under each title, and use Description Limit to keep it brief.
  • Under Content Display Style, choose Classic to show the text outside the photo, or Overlay to place it on top of the photo.

Finally, fine-tune the typography, colors, and spacing until the text feels right.

Step 6: Choose What Happens When Someone Clicks a Photo

Open the Image Click Action panel. Under Click Action Type, you can pick one of three options:

  • Lightbox: The photo opens in a full-screen view. This is the right choice for most photo galleries.
  • URL: Each photo links to a page you choose.
  • None: Photos are just for display, with no click action.

What Visitors Get With the Lightbox

The ShapedGallery lightbox works well on every device. On phones, visitors swipe between photos and pinch to zoom. On desktop, they zoom up to 4x with a double-click or the mouse wheel. Keyboard users can browse with the arrow keys and close the view with Escape.

You can adjust two lightbox options for your whole site under ShapedGallery → Settings → Modules: Close When Click Outside and Item Counter. The counter shows visitors where they are, such as “3 / 24.”

Step 7: Keep Large Galleries Fast With Load More

Twenty photos load quickly. Two hundred photos are a different story, especially on a phone with a weak signal. Luckily, you do not have to choose between a big gallery and a fast page.

In Layout Settings, turn on Ajax Pagination. A new Ajax Pagination panel then appears with these options:

  • Show Per View: How many photos load at first, and with each click. You can set a smaller number for mobile.
  • Button Label: Change the text to something friendly, such as “Show More Bouquets.”
  • Ending Message: The note visitors see once every photo has loaded.
  • Alignment, colors, and borders: Style the button so it matches your site.

ShapedGallery also handles several speed tasks for you in the background. It lazy loads images as visitors scroll, and it loads its files only on pages that actually show a gallery. For even more control, visit ShapedGallery → Settings → Advanced Controls. There you can manage Retina Images, gallery caching, and browser caching.

Bonus idea: In Layout Settings, set Order to Random. Returning visitors then see a fresh mix of photos each time they come back.

Step 8: Lock the Gallery if It Is Private (Optional)

Some galleries are not meant for everyone. For example, you want a gallery keep private for now and publish on a public page later.

To handle this, open Advanced Settings and find Visibility. You will see three choices:

  • Public: Everyone can see the gallery.
  • Password: Visitors must enter a password first. Type it into the Set Password field.
  • Private: Only logged-in editors and administrators can see it. This works well for drafts and internal reviews.

The password locks only the gallery, not the whole page. So the rest of your page stays public, and you only share the password with the right people.

Step 9: Preview, Publish, and Reuse Your Gallery

Before you publish, preview the page on desktop, tablet, and mobile. Click a few photos to test the lightbox, and try the Load More button if you turned it on. When everything looks right, click Publish.

Reuse One Gallery on Many Pages

What if you want the same gallery on your home page, your About page, and a landing page? Instead of building it three times, create a saved gallery.

  • Go to ShapedGallery → Add New Gallery.
  • Build the gallery with the same steps you just learned, then publish it.
  • In the Gallery Information panel, click Copy shortcode. It looks like [shaped_gallery id=”123″].
  • Paste the shortcode into any page, post, or widget.

From now on, you edit the gallery in one place, and every page updates on its own. You can manage all of your galleries under ShapedGallery → Saved Galleries.

Do you build pages with Elementor, Divi, Bricks, Oxygen, Beaver Builder, or WPBakery? ShapedGallery adds a dedicated element for each of them. Elementor support is on by default, and you can turn on the others under ShapedGallery → Settings → Integrations.

Common Mistakes to Avoid

Even a great tool cannot save a gallery from a few classic mistakes. Watch out for these:

  • Uploading huge camera files. Big originals slow down your Media Library and your page. Resize them before upload, and pick Large as the gallery resolution.
  • Skipping alt text. Without it, screen reader users miss your photos, and search engines learn less about them. Two minutes per gallery is all it takes.
  • Using the same columns on every device. Four columns on a phone means tiny photos. Always set fewer columns for tablet and mobile.
  • Choosing Grid for mixed photo shapes. Grid crops photos into squares. If your set mixes tall and wide shots, use Auto. Justified or Masonry instead.
  • Loading hundreds of photos at once. Turn on Ajax Pagination so visitors load photos in smaller batches.
  • Never testing on a real phone. The editor preview helps, but nothing beats opening the live page on your own phone and tapping through it.

Frequently Asked Questions

How do I create a photo gallery in WordPress without code?

Install a gallery plugin that works as a block, such as ShapedGallery. Then add the block to a page, pick a layout, select your photos, and adjust the settings in the sidebar. You never need to touch code.

Can I use the built-in WordPress Gallery block instead?

Yes, for simple galleries. However, if you need justified or masonry layouts, separate columns for each device, a Load More button, or password-protected galleries, a gallery plugin such as ShapedGallery gives you those options in the same editor.

How do I make my photo gallery responsive?

Set different columns and gaps for desktop, tablet, and mobile. In ShapedGallery, use the device switcher in Layout Settings. Two columns on mobile is a safe starting point for most galleries.

What size should my gallery images be?

For most galleries, images around 1,600 to 2,000 pixels wide give a sharp result in the lightbox without huge files. Then choose Large under Resolution, so the gallery grid itself stays light.

Can I add videos to the same gallery?

Yes. ShapedGallery accepts Media Library videos, video links, and YouTube links in the same gallery as your photos. Simply choose Videos, External Video, or YouTube in the media window.

Will a large photo gallery slow down my WordPress site?

It does not have to. Use Ajax Pagination to load photos in batches, keep the resolution at Large, and let lazy loading do its job. ShapedGallery also loads its files only on pages that include a gallery.

Build Your Responsive Photo Gallery

Ready to try it? Here is the quick recap:

  • Go to Plugins → Add New Plugin in your dashboard.
  • Search for ShapedGallery, then Install and Activate.
  • Add the ShapedGallery block and pick a layout.
  • Add your photos and write alt text.
  • Set columns for desktop, tablet, and mobile.
  • Style it, choose the click action, and turn on Load More for big sets.
  • Preview on your phone, publish, and reuse it with a shortcode.

Install ShapedGallery and build a photo gallery that looks great on every screen. You can learn more at shapedgallery.com.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *