Docs

Loop Filter

Category buttons, a dropdown, checkboxes, a search box or a sort menu that filter a post grid without reloading.

On this page

The Loop Filter widget lets visitors narrow down a Loop Grid or Posts widget on the same page: by category or tag, with a search box, or by changing the sort order. The grid updates without reloading the page, and the address in the browser changes too, so a filtered view can be shared or bookmarked.

A row of pill buttons All posts, Design notes, Materials and Renovation, with All posts selected, above a grid of three blog cards
A Loop Filter with category buttons above the Loop Grid on the Journal page.

Add a Loop Filter

Add the grid first. Then click Insert in the rail on the left, find Loop Filter in the Site & theme group (or type "filter" in the search box) and drag it above the grid. See Add elements.

The filter finds the grid on the page by itself. If the page has several grids, give the one to filter an Anchor ID in its Behaviour → Anchor & classes section, and type the same ID in the filter's Grid anchor ID.

You can add several filters for the same grid, for example category buttons and a search box. They work together.

Choose the kind of filter

  • Category, tag or taxonomy: pick the Taxonomy and a Display: Buttons (with Allow several at once if visitors may pick more than one), a Dropdown or Checkboxes.
  • Custom field: type the Field key of a custom field the posts have (a job's location, a home's bedrooms) and pick a Display. Visitors choose one of the values, or, for numbers, a threshold such as £40,000+. See Filter by a custom field.
  • Search: a search box that filters the grid by the words typed.
  • Sort order: a menu with the Sort options you choose, such as Newest first or Title A–Z.

Without JavaScript, the filter still works: buttons are plain links and the search and sort use a normal form, so the page reloads with the filtered grid.

Content tab settings

Content tab · Filter
SettingWhat it does
Grid anchor IDThe Anchor ID of the Loop Grid or Posts widget to filter. Only needed when a page has several grids.
Filter byCategory, tag or taxonomy, Custom field, Search or Sort order. Default: Category, tag or taxonomy.
Field keyThe key of the custom field to filter by, for example location. Fields whose key starts with _ are private and cannot filter. Shown for Custom field.
Show posts whose fieldIs the chosen value, Is at least the chosen number or Is at most the chosen number. Shown for Custom field.
OptionsOne choice per line: the value, or Label|value (Remote (UK)|remote, £40,000+|40000). Empty: the values the published posts have, A–Z. Thresholds need options. Shown for Custom field.
TaxonomyCategories or Tags (and other public taxonomies of your site). Default: Categories.
DisplayButtons, Dropdown or Checkboxes. Default: Buttons. A number threshold takes one choice, so checkboxes show as a dropdown.
Allow several at onceVisitors can select more than one button. Shown for Buttons.
Show "All"Adds a button or option that clears the filter. On by default. Not shown for checkboxes.
"All" labelThe text of that option. Default: All.
Show countsShows the number of posts next to each term.
Hide empty termsLeaves out terms without posts. On by default.
Top-level terms onlyLeaves out child categories.
OrderThe order of the terms. By name sorts them A–Z, Most posts first puts the most used terms first, and In the order below shows the terms you list in Terms, in order. Default: By name.
Terms, in orderComma-separated slugs of the terms to show, for example insight, press, news. Only these terms are shown, in this order. Empty: all terms, by name. Because it uses slugs, not IDs, a Site Kit import keeps the order. Shown for In the order below.
Exclude term IDsComma-separated IDs of terms to leave out, for example 1 for Uncategorized. Find an ID by hovering the term under Posts → Categories.
PlaceholderThe hint text in the search box. Default: Search…. Shown for Search.
Sort optionsAny of Newest first, Oldest first, Title A–Z, Title Z–A, Recently updated, Most commented and Custom order. Default: Newest first, Oldest first, Title A–Z. Shown for Sort order.
LabelText shown before the filter; also its name for screen readers.
Label positionBeside the filter or Above the filter: the label on its own line, with a dropdown or search box as wide as the widget. Use it for a row of filters, such as a job board's sector, location and salary. Shown when there is a Label.

Design tab settings

Design tab
SectionSettings
Buttons & fieldsAlignment, Gap, Typography, Text color, Background, Border color, Active text and Active background (the selected button), Radius, Padding.

The Design tab also has the sections every element shares: Spacing & position, Background & border and Mask. See Spacing, size & position.

Behaviour tab

The Behaviour tab has the settings every element shares: anchor and classes, entrance animations, motion effects, visibility per device, display conditions and interactions. See Visibility.

Tips

  • On phones, a Dropdown takes less room than a long row of buttons. Use two filters, one hidden on mobile and one hidden on desktop, with Behaviour → Visibility.
  • Filtering works on the grid's own query: a grid that shows only one category can be filtered by tag, for example.