Categoría: BRICKS BRICKS/POSTS/QUERY_VARS PRO
-
Posts Published in the Last x Days in Bricks
Updated on 1 Feb 2024 This Pro tutorial shows how to limit the posts output by either the Posts element or a Query Loop in Bricks to those published in the last 14 days. Query Loop Enable Query editor (PHP) and paste: $date_query = [ [ ‘after’ => ’14 days ago’, ] ]; return […
-
Posts from Random Categories in Bricks
Updated on 31 Jul 2023 In BricksLabs Facebook group a user asked: How would you query 3 WordPress posts from 3 different categories with Brick Builder query loop function? Case #1: the categories do not matter. Case #2: the categories matter. This Pro tutorial provides the steps to tackle case #1 wherein we construct an…
-
Display 3 Category-related Posts and Supplement with the Latest Published Posts if Necessary
In the Bricks Facebook group a user asks: Show latest 3 related posts based on category and IF THERE ARE NOT ENOUGH, fill the empty spots with latest published postsHi, is this possible with the query builder and how would I have to set up my query to accomplish this?If this is not possible, showing…
-
Previous Two Posts in Bricks Query Loop
This Pro tutorial shows how we can modify the parameters of a Bricks query to limit the posts to the previous two whilst cycling to the latest post if necessary when viewing single posts. Array Index Post Number Sample Post ID Previous Posts 0 7 (latest) 16 [6, 5] 1 6 19 [5, 4] 2…