Sorting Relationship Query Results in Bricks

This Pro tutorial show how bricks/query/result filter in Bricks builder can be used to sort the results of a ACF (should also work with Meta Box) Relationship query in

  • ascending order of post title
  • descending order of post title
  • ascending order of post date
  • descending order of post date

By default the results will be in the order the related posts are arranged (on the right side of the screenshot below) for a post. These can be manually dragged and dropped around in the desired order.

Step 1

Install and activate ACF Pro.

Step 2

Create two CPTs say, service and faq.

Create a field group named Service FAQ Relationship Group.

We have created a single field group that will appear when the entries of either CPTs are edited.

Step 3

This step is not needed in ACF Pro v6.2 and above.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro