How to Order Posts by Post Meta in Bricks

Updated on 4 Feb 2024

This Pro tutorial provides the steps to show posts marked as featured at the top and then the other posts below them (sorted either by title or date) in Bricks.

Testimonial posts list:

On frontend:

Step 1

Use your favorite custom fields plugin to set up a custom field whose value gets saved as 0 or 1. This could be ACF's True / False or Checkbox or Meta Box's Switch field.

We used a Meta Box Switch-type field in our test site.

Step 2

Edit your template/Page with Bricks and add a Section.

Inside the Section's Container, add a Posts element or a query loop-enabled Block.

Edit the query and select your post type if needed.

Next, we shall

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 537 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Show Product Categories Count Using Bricks Filter Hook

Show Product Categories Count Using Bricks Filter Hook

Unable to find terms count from the Dynamic Data provided by Bricks theme? It's okay, this simple tutorial shows you how to properly get the…
Categories:
Tags:
How to Add a Custom Control Field to an Element in Bricks

How to Add a Custom Control Field to an Element in Bricks

In this tutorial, we'll learn how to add a custom control field to an element and dynamically change a CSS property inside the builder. Introduction…
Categories:
Tags:
Pro
Setting a Bricks template for Parent pages

Setting a Bricks template for Parent pages

This Pro tutorial shows how bricks/active_templates filter can be used to programmatically assign a Bricks template to all singular pages (of any post type) that…