Portfolio Loop Filter

Description

Portfolio Loop Filter adds a dynamic block for the WordPress block editor. The block creates filter buttons from the used terms of a selected taxonomy and filters the next Query Loop block below it.

The plugin is designed for block themes and portfolio grids that already use the native WordPress Query Loop block. It does not replace the Query Loop, does not register custom post types, and does not use AJAX on the frontend. The frontend script only toggles the visibility of Query Loop items that are already rendered on the page.

Typical use cases:

  • Filter a portfolio Query Loop by project categories.
  • Filter posts by categories or tags.
  • Place multiple independent filter and Query Loop pairs on the same page.
  • Keep content management inside WordPress core blocks while adding lightweight frontend filtering.

Features:

  • Dynamic Gutenberg block.
  • Post type dropdown in the block settings.
  • Taxonomy dropdown based on the selected post type.
  • Automatic filter buttons from used taxonomy terms.
  • Filter button ordering: alphabetical A-Z, alphabetical Z-A or manual.
  • Manual ordering controls directly in the block sidebar.
  • Newly added terms are appended automatically when manual ordering is used.
  • Filters only the next Query Loop below the filter block.
  • Optional “All” button, which remains first regardless of term ordering.
  • Button alignment: left, center or right.
  • Color controls for text, active text, border, background, active background and hover/focus border.
  • Fallback styles when no custom colors are selected.

Blocks

This plugin provides 1 block.

  • Portfolio Loop Filter Creates filter buttons from used taxonomy terms and filters only the next Query Loop below the block.

Installation

  1. Upload the plugin files to the /wp-content/plugins/portfolio-loop-filter/ directory or install the plugin ZIP through the WordPress plugins screen.
  2. Activate the plugin through the “Plugins” screen in WordPress.
  3. Edit a page or template that contains a Query Loop block.
  4. Insert the “Portfolio Loop Filter” block directly above the Query Loop that should be filtered.
  5. Select the post type and taxonomy in the block sidebar.
  6. Choose the desired filter button order and optional styling settings.
  7. Save the page or template.

FAQ

Does this plugin create a portfolio post type?

No. It intentionally does not register custom post types or taxonomies. You can use WordPress posts, ACF-generated post types, or any other public post type that appears in the block settings.

Does the plugin replace the Query Loop block?

No. The native WordPress Query Loop block remains responsible for rendering the grid. This plugin only adds filter buttons and a small frontend script.

How are filter buttons sorted?

You can sort taxonomy filter buttons alphabetically from A-Z, alphabetically from Z-A, or manually. In manual mode, use the arrow controls in the block sidebar to set the order. The optional “All” button always remains first.

What happens when I add a new taxonomy term while using manual ordering?

Newly used terms are appended after the saved manual order, so they remain visible without requiring the block to be recreated. You can then move them to the desired position in the editor.

Can I use multiple filters on one page?

Yes. Each filter block controls the next Query Loop block below it. Use the structure “Filter, Query Loop, Filter, Query Loop” when placing multiple filterable grids on the same page.

Why do some terms not appear as buttons?

The block only renders terms that are used by published posts of the selected post type. On the frontend, buttons without a matching item in the next Query Loop are hidden automatically.

Does the frontend filtering reload the page?

No. The plugin filters existing items in the browser. It does not perform frontend AJAX requests.

Does filtering load posts from other Query Loop pagination pages?

No. Filtering applies only to items already rendered in the targeted Query Loop on the current page. The plugin does not change the Query Loop query or fetch additional paginated posts.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Portfolio Loop Filter” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0

  • Added filter button ordering by alphabetical A-Z, alphabetical Z-A or manual order.
  • Added accessible manual ordering controls in the block sidebar.
  • Added a live editor preview using the actual used taxonomy terms and selected order.
  • Added automatic handling for newly used taxonomy terms in manual order mode.
  • Updated compatibility metadata and reviewed the block for WordPress 7.1, including the iframe-based editor.
  • Updated plugin documentation and FAQ.

0.9

  • Added the Portfolio Loop Filter block.
  • Added post type and taxonomy dropdowns.
  • Added automatic taxonomy term buttons.
  • Added next Query Loop targeting for multiple independent filter and loop pairs.
  • Added button alignment controls.
  • Added color controls and fallback styles.
  • Added WordPress.org-style plugin headers, readme and GPL license information.