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

Instant access to 390+ Bricks code tutorials with BricksLabs Pro