How to create a filterable ACF Gallery

I recently built filterable logo gallery for a Vimeo.com landing page. Here's how I did it.

What we’re building

This is an ACF logo gallery on a Vimeo.com landing page I built recently. The Vimeo content team uploads images to the gallery and order them how they like. "ACF logo gallery"

Each filter (Industry, Region, Size) is a custom taxonomy assigned to the attachment post type. As you select options from the filters, you narrow down the list of logos. I’m not sure what to call it, but there’s a dynamic sentence below the filters that let you know what you’re looking at. Within the sentence you can dismiss the little pills to clear that filter out. "ACF logo gallery - filtered"

Taxonomies as filters

For each filter you want to create (remember, each filter is representative of a taxonomy), you can use get_terms() to get all of the options.

My Industry filter looks like this (minus the Alpine JS for simplicity):

<?php
    $terms = get_terms( 'industry', array(
        'hide_empty' => true, // hide unassigned terms
    ) );
?>

<button>Select Industry</button>
<ul>
    <?php foreach ($terms as $term) { ?>
        <li><?= $term->name; ?></li>
    <?php endforeach; ?>
</ul>

Hire an expert web developer for less

The average salary for a junior dev in the US is $70,000. Hiring me costs about 25% less.

Piccolo

$4,500/mo

  • One concurrent request

  • Turnaround time in days, not weeks
  • Pause or cancel anytime
Get started

Grande

$7,500/mo

  • Two concurrent requests

  • Turnaround time in days, not weeks
  • Pause or cancel anytime
Get started

Want to talk with me first?

Learn more about how I work and discuss your project on a free call.

Schedule a call

Unsure? Let's make this really easy for you.

Within the first 3 weeks of your initial month, if you're not completely satisfied for any reason, just let me know, and I'll will refund your fee and cancel your subscription. That's something you wouldn't get from a full-time employee or some random freelancer.