Updated on 29 Oct 2022
Bricks has an excellent filter called
bricks/posts/query_vars for modifying the query of Posts and Product elements to modify the query with dynamic values and options not available in the editor.
In this Pro tutorial, we share a few practical examples of using this filter to filter the posts' output to
- Posts published in the specified year
- Posts published this week
- Posts published this month
- Posts authored by the currently logged-in user
- Upcoming/Future Events i.e., future events when using an Events plugin or date custom field
- Posts yet to be published i.e., future posts
while ensuring that the correct instance of the Posts element is targeted.
Posts published in the specified year
Add a Posts element.
Then add the following in child theme's
functions.php or a code snippets plugin like WPCodeBox:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account