,

How to Create an Image Gallery With Categories in WordPress (Step by Step)

Illustration of a gallery with category tabs above a grid of photos in a browser window

Do you have lots of photos that belong to different groups, like nature shots, interiors, and weddings? Putting them all in one long gallery makes visitors scroll past photos they do not care about. A gallery with categories fixes that. People pick the category they want and see only those images.

In this guide, you will learn how to create an image gallery with categories in WordPress. We will start with a simple method that uses headings and jump links, then build a tabbed category gallery with Galleryberg and Ultimate Blocks. There is a live demo below, so you can click through the categories yourself.

Why Organize a Gallery Into Categories?

Categories turn a big pile of photos into something easy to browse. Here is why that matters:

  • Visitors find what they want faster. A wedding client does not need to scroll through your product shots.
  • Pages load lighter. Smaller galleries are easier to keep fast.
  • Your work looks more professional. Photographers, designers, agencies, and shops all use categories to show they have range.
  • It is easier to update. You can add photos to one category without touching the others.

Here are common examples: a photographer with Weddings, Portraits, and Events; a restaurant with Food, Drinks, and Interior; a travel blog with one category per country; or a store with one category per product line.

Live Demo: A Category Gallery Built With Galleryberg

Click the tabs below. Each tab is a separate Galleryberg gallery with its own lightbox, so clicking a photo opens only the images from that category.

This demo uses the Ultimate Blocks Tabbed Content block with one Galleryberg gallery in each tab, set to the Tiles layout with 4 columns on desktop and 2 on tablets and phones. Let’s build it step by step.

Method 1: Create Category Sections With Headings and Jump Links

The simplest way to group photos is to give each category its own heading and gallery on the same page. It works with any theme and needs no extra blocks. You can do this with the default WordPress Gallery block, but Galleryberg gives you more layouts and a built in lightbox, so we will use it here.

Step 1: Add a Heading for Each Category

Open the page in the block editor and add a Heading block for your first category, for example “Nature”. In the block settings, open Advanced and type a short word in the HTML anchor field, such as nature. Repeat this for each category.

Step 2: Add a Galleryberg Gallery Under Each Heading

Under each heading, click the plus (+) button, search for Galleryberg Gallery, and add your images from the Media Library. If this is your first time, our guide on how to create an image gallery in WordPress covers the basics.

Step 3: Add Jump Links at the Top

At the top of the page, add a Paragraph or Buttons block with one link per category. Set each link to #nature, #interiors, and so on, matching the anchors you typed. When visitors click a link, the page scrolls straight to that category.

This method is great when you want every photo on one page for search engines, or when you have many categories. The downside is that the page can get very long, which is where tabs help.

Method 2: Create a Tabbed Category Gallery With Galleryberg

Tabs show one category at a time, so the page stays short and tidy. For this you need two plugins, both made by DotCamp:

  • Galleryberg for the galleries. The core Galleryberg plugin includes the Tiles, Square, Masonry, and Justified layouts plus the lightbox.
  • Ultimate Blocks for the Tabbed Content block.

Step 1: Install Galleryberg and Ultimate Blocks

In your dashboard, go to Plugins > Add New Plugin. Search for “Galleryberg”, then click Install Now and Activate. Do the same for “Ultimate Blocks”.

Installing the Ultimate Blocks plugin from the WordPress plugin directory

Step 2: Add the Tabbed Content Block

Open your page, click the plus (+) button, and add the Tabbed Content block. Click each tab title and type a category name, such as Nature, Interiors, and Weddings. Use the plus button next to the tabs to add more categories.

Step 3: Add a Galleryberg Gallery to Each Tab

Click inside the first tab, then add a Galleryberg Gallery block. Choose the photos for that category from the Media Library. Then open the next tab and repeat with that category’s photos.

Adding a Galleryberg gallery block inside a tab of the Tabbed Content block

Step 4: Pick a Layout and Columns

Select a gallery and choose a layout in the settings sidebar. Tiles or Square work very well inside tabs because each thumbnail has the same shape. Set the columns for desktop, tablet, and mobile separately, for example 4, 2, and 2. Learn more in our guide to responsive galleries.

Tip: use the same layout and columns in every tab. When all categories look alike, switching tabs feels smooth instead of jumpy.

Step 5: Turn On the Lightbox

Enable the Lightbox toggle for each gallery so visitors can click a photo and see it full size. Because every tab has its own gallery, the lightbox only cycles through photos from that category. You can also add a hover effect such as zoom in. See how to add lightbox effects to WordPress galleries for all the options.

Step 6: Style the Tabs

Select the Tabbed Content block and set the tab colors to match your brand. Center the tabs so they sit nicely above the gallery. Then click Update or Publish and test the page on your phone.

Galleryberg Pro Options for Category Galleries

If you use Galleryberg Pro, you get extra ways to make each category stand out:

  • Mosaic layout to give one hero photo per category a bigger tile.
  • Carousel layout to show a category as a swipeable row, handy for small screens.
  • Randomize order on page load so returning visitors see a fresh mix in each category (this works on grid layouts, not on the Carousel).
  • Lightbox thumbnails so visitors can jump between photos inside a category.
  • ACF dynamic source to pull each category’s images from an ACF Gallery field, useful when categories are custom posts like projects or listings.

Tips for Better Category Galleries

  • Keep category names short. One or two words fit on one line, even on phones.
  • Put your best category first. The first tab is what most visitors see.
  • Use a similar number of photos in each category. Six to twelve images per tab is a good range.
  • Write alt text for every image. It helps screen readers and image search. Good alt text describes what is in the photo in a few plain words.
  • Link to a category from other pages. If a category grows large, move it to its own page with a clean URL. See how to create a unique URL for a WordPress gallery.
  • Need ideas? Our travel photo gallery and portfolio gallery tutorials use the same idea for real projects.

Frequently Asked Questions

Can I put one gallery in several categories?

Yes. A Galleryberg gallery is just a block, so you can add the same photo to as many category galleries as you like. Each gallery keeps its own order, layout, and lightbox. The image is stored once in your Media Library, so adding it to more galleries does not use more space.

Do Galleryberg galleries work inside tabs?

Can visitors filter one gallery by category with buttons?

How many categories should a gallery page have?

Conclusion

A gallery with categories makes it easy for visitors to find the photos they care about. Use headings and jump links when you want everything on one page, or use the Ultimate Blocks Tabbed Content block with one Galleryberg gallery per tab for a clean, compact layout like the demo above.

Give it a try on your own site with the core Galleryberg plugin, and upgrade to Galleryberg Pro when you want Mosaic, Carousel, and other advanced layouts.