21st Nov '23
/
0 comments

Published Years Filters in Bricks

In the Posts Grouped by Years in Bricks tutorial, we showed how posts can be grouped by all the years in which there are published posts.

This Pro tutorial for Bricks users provides the steps to automatically assign the year in which posts are published as a term to a custom taxonomy (year-published) so the posts can be filtered using all the published years in the site - using a plugin like WP Grid Builder.

This means the years will be dynamic, completely on autopilot and need not be manually updated.

Step 1

Create a custom taxonomy called say, year-published for your post type using code or a plugin like CPT UI or ACF or Meta Box.

Step 2

Add the following in child theme's functions.php or a code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 633 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
How to hide Bricks Query Loop Posts until WP Grid Builder Facets are applied

How to hide Bricks Query Loop Posts until WP Grid Builder Facets are applied

How to hide the Bricks QL posts until there’s an interaction by the user on the frontend like ticking a category or typing in a…
Categories:
How to create filters with IsotopeJS in Bricks (Part 2): Dynamic Image Galleries

How to create filters with IsotopeJS in Bricks (Part 2): Dynamic Image Galleries

This tutorial series will review how to create a dynamic filterable image gallery using the IsotopeJS library‘s features in Bricks. Requirements Create a custom taxonomy for your…
Removing Action/Filter Inside a Plugin’s Namespaced Class Constructor

Removing Action/Filter Inside a Plugin’s Namespaced Class Constructor

Recently worked with a friend figuring out how to remove/undo/cancel an add_action() line that's inside a plugin's constructor inside a PHP Class with the file…
Categories:
Tags:
Pro
How to Move an Element into Another on Smaller Viewports in Bricks

How to Move an Element into Another on Smaller Viewports in Bricks

This Pro tutorial provides the steps to move a Block containing a Heading and WP Grid Builder's Facet into BricksExtras' OffCanvas element for viewports 991px…