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 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
How to Limit a WP Grid Builder’s Term Grid to Only Current Post Terms

How to Limit a WP Grid Builder’s Term Grid to Only Current Post Terms

In the WP Grid Builder Facebook group (unofficial), a user asks: Hi All, I'm looking for a way to update the contents of a grid…
Categories:
Pro
Stock Quantity Block for WP Grid Builder

Stock Quantity Block for WP Grid Builder

In the unofficial WP Grid Builder Facebook group a user asked: Is it possible to show stock quantity on the card? I can't find it…
Categories:
bricks/posts/merge_query Explained

bricks/posts/merge_query Explained

This short article provides details on Bricks' bricks/posts/merge_query filter. On pages rendered by an archive or search template, secondary queries like the ones used for…
Categories:
Tags:
How to hide/remove the Block Element from the Bricks Builder

How to hide/remove the Block Element from the Bricks Builder

Don't like the new Block element in Bricks? Just copy/paste the following code into your child theme's functions.php. By the way, It's a terrible idea…
Categories:
Tags:
Pro
Filtering Meta Box Cloneable Group by Select Subfield for Multiple Bricks Query Loops with Conditional Output

Filtering Meta Box Cloneable Group by Select Subfield for Multiple Bricks Query Loops with Conditional Output

In the Bricks Facebook group a user asks: Consider this cloneable Meta Box field group for a Custom Post Type called Tour: with the Tour…