Skip to content

How to Create WordPress Image Gallery with Category Filter?

Key Takeaways

  • Nexter Blocks Media Listing block creates a WordPress image gallery with a category filter by selecting Images in the Type section and Repeater in the Content tab.
  • Category Wise Filter appears in the Filters tab, and the Category option is only available for Repeater, not for the Carousel layout.
  • All Category Text edits the “All” filter label, while Filter Style, Filter Hover Style, and Filter Alignment control the category filter labels’ appearance and placement.
Table of Contents

A gallery of fifty photos is hard to search when a visitor only wants one kind of shot.

The Media Listing block can show filter tabs above the gallery so visitors narrow it down in place.

For every Media Listing setting in one place, see the Media Listing block guide.

Before You Start

  • Edition: Pro — the Media Listing block is part of Nexter Blocks Pro.
  • Block to enable: Media Listing, switched on under Nexter > Blocks in your WordPress dashboard.
  • Your images uploaded: add them to the Media Library first so you can pick them straight from the block.

Steps

  1. Add the Media Listing block to your page and click Design from Scratch.
  1. In the Layout panel, set Type to Images.
The Layout panel with the Type setting set to Images
  1. Open the Content panel and set Select Option to Repeater.
The Content panel set to Repeater with the Title field for one item
  1. Click + Add Item for each photo, then set its Image, Title and Caption.
  1. On each item, fill in Category (Separated by comma). Items that share a category are grouped under the same tab.
The Category field on a repeater item
  1. Open the Filters panel and switch Category Wise Filter on.
The Filters panel with Category Wise Filter switched on
  1. Set All Category Text if you want the first tab to read something other than All, pick a Filter Style, then publish.
The Filter Style setting
A gallery with All, Mountains, Coast and Waterfalls filter tabs

How It Behaves

  • The tabs are built from the categories you typed on the items, in the order they first appear.
  • Clicking a tab hides everything outside that category without reloading the page. Selecting Coast in a nine photo gallery leaves only the three Coast photos on screen.
  • An item with several comma separated categories appears under each of them.
  • The first tab shows everything, and its label comes from All Category Text.
The same gallery after clicking the Coast tab, showing only the three Coast photos

Limitations

  • Pro only.
  • The filter needs Repeater content. Images picked under Normal have no category field, so no tabs appear.
  • The filter does not appear on the Carousel layout.
  • Categories are free text on each item, so Coast and coastal create two separate tabs.
  • The filtering happens in the browser, so every photo still loads with the page.

Troubleshooting

Only the All tab shows

The items have no categories yet. Fill in Category (Separated by comma) on each repeater item and the tabs appear.

No tabs at all

Check two things: Select Option must be Repeater, and Layout must not be Carousel.

One photo is under the wrong tab

Look for a typo or a stray space in that item’s category. Each distinct spelling becomes its own tab.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!