This Pro tutorial provides the steps to set up nested query loops in Bricks for grouping posts by their authors.
For the posts under each author, we shall show one latest post with the rest appearing after an accordion's button is clicked.
Step 1
Install and activate BricksExtras.
Enable Pro Accordion element.
Step 2
Let's define three custom functions:
bl_get_loop_user(): returns the WP_User object from the specified loop (in this case, the outer user query loop)bl_get_loop_user_prop(): returns the specified property (likeID) from the WP_User object currently being looped through in the outer user query loopbl_get_loop_user_post_count(): returns the number of published posts authored by the user in a Bricks query loop minus 1
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