Posts Published Today in Bricks

In this Pro tutorial we are going to prefilter the posts using a date query to those published today and conditionally output the Bricks Section having the Posts element/Query Loop only if there is at least 1 published post today.

Additionally, we shall programmatically add "s" at the end of "Today's Article" if there is more than 1 post published today.

Add a Section having a Today's Article Heading and Posts element.

Add the following in child theme's functions.php (w/o the opening PHP tag) 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