Month and Day Condition in Bricks

This Pro tutorial shows how we can define a custom function that takes in a month in the three-letter format (like Dec) and a day number (like 25) and use it with Dynamic data condition of Bricks to output or not output elements on specific month and day whilst taking the site's timezone setting into account.

Use case: Render a banner only on special days/holidays every year automatically. Ex.: on Christmas day.

Step 1

Add this 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