Posts Grouped by Authors in Bricks

This Pro tutorial for Bricks users provides the steps to loop through users and inside that, through posts whilst setting the inner query's author parameter to the one in the outer loop for outputting posts grouped by their authors.

We shall fetch 4 posts in each group and render a "See more posts by this user" button only for users that have published more than 4 posts. The button will be linked to author posts' URL.

Step 1

Edit a Page with Bricks.

Copy this JSON and paste to get:

Step 2

Add the following in child theme's functions.php 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 524 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Post Data for the Current User in Bricks with Meta Box

Post Data for the Current User in Bricks with Meta Box

In the Bricks Facebook group a user asked: I need help with Metabox and Bricks! I have created a CPT "SalesRep" with multiple custom fields…
Categories:
Pro
Posts older than today in Bricks

Posts older than today in Bricks

How to display only posts that were published before today in a query loop.
Categories:
Pro
CPT Posts Grouped by Custom Taxonomy Terms in Bricks

CPT Posts Grouped by Custom Taxonomy Terms in Bricks

The steps to set up a Service Category terms loop with an inner Service posts loop in Bricks without writing code.
Categories:
Pro
Parent post Bricks query loop

Parent post Bricks query loop

Updated on 5 Feb 2024 In the BricksLabs Facebook group a user asks: Is there a way to output the data of a parent post…
Categories:
Pro
Events grouped by Event Date custom field in Bricks

Events grouped by Event Date custom field in Bricks

This Pro tutorial for Bricks users provides the steps to output posts of an event custom post type dynamically grouped by the value of their…
Categories:
Pro
6 Random Featured Posts in Alphabetical Order in Bricks

6 Random Featured Posts in Alphabetical Order in Bricks

How to output x number of random posts with a specific meta value set, in Alphabetical order.
Categories: