22nd Nov '22
/
0 comments

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

Get access to all 625 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Restrict Content Pro in Bricks

Restrict Content Pro in Bricks

This Pro tutorial provides the steps to restrict Pages and individual elements like Sections in Bricks depending on whether the current user has any active…