Moritz Reitz
← Back to blog
Bricks BuilderMeta Box ProWeb Development

How to Query Reordered Meta Box Posts in Bricks Builder (Complete Guide)

How to display Meta Box drag-and-drop reordered posts in Bricks Builder — use Order By Menu Order (ASC) in the Query Loop, or WP_Query with orderby: menu_order.

4 November 2025 · Moritz Reitz

I have recently tried to query posts in Bricks Builder in the order that I have reordered them with meta box's drag and drop feature. In short you will have to order by menu_order and then choose ascending.

image

The menu_order value is stored in your _posts table:

image

Understanding Meta Box's Reordering System

When you use Meta Box's drag-and-drop reordering feature (available in Meta Box AIO or the MB Admin Columns extension), it stores the order using WordPress's native menu_order column in the database. This is a built-in WordPress feature that assigns a numeric value to each post, with lower numbers appearing first.

How menu_order Works

  • Each post gets assigned a menu_order value (typically 0, 1, 2, 3, etc.)
  • Lower numbers = higher priority in ordering
  • By default, most posts have a menu_order of 0
  • When you drag and drop, Meta Box updates these values automatically

Method 1: Query Loop in Bricks Builder (Recommended)

The most straightforward way to display reordered posts in Bricks Builder is through the Query Loop settings.

Step-by-Step Instructions

  1. Select Your Query Loop Element
    • Add or select a Query Loop, Posts, or any element that uses queries in Bricks
  2. Access Query Settings
    • Click on the element
    • Navigate to the Query settings panel
  3. Configure the Query
    • Set your post type (e.g., Portfolio, Team Members, etc.)
    • Scroll down to "Order By"
    • Select "Menu Order" from the dropdown
    • Set Order to "ASC" (Ascending)
  4. Save and Preview
    • Your posts should now appear in the exact order you set in Meta Box
image

Query Loop Settings Breakdown

Post Type: your_custom_post_type
Posts Per Page: -1 (for all posts)
Order By: Menu Order
Order: ASC

Method 2: Custom Query with Code

For more advanced use cases, you can create a custom query using PHP. This is useful when working with custom elements or dynamic data.

Using WP_Query

Add this code to your child theme's functions.php or a custom plugin:

function get_reordered_meta_box_posts() {
    $args = array(
        'post_type'      => 'your_post_type',
        'posts_per_page' => -1,
        'orderby'        => 'menu_order',
        'order'          => 'ASC'
    );
    
    $query = new WP_Query($args);
    
    return $query;
}

Registering a Custom Query in Bricks

To use this in Bricks Builder, you'll need to register a custom query:

add_filter('bricks/query/run', function($results, $query_obj) {
    if ($query_obj->object_type !== 'my_custom_query') {
        return $results;
    }
    
    $args = array(
        'post_type'      => 'your_post_type',
        'posts_per_page' => -1,
        'orderby'        => 'menu_order',
        'order'          => 'ASC'
    );
    
    $custom_query = new WP_Query($args);
    
    return $custom_query->posts;
}, 10, 2);

Then in Bricks:

  1. Select your Query Loop
  2. Query Type: Custom
  3. Custom Query ID: my_custom_query

Method 3: Using Bricks Query Filters

For dynamic filtering combined with menu order, use query filters:

add_filter('bricks/posts/query_vars', function($query_vars, $settings, $element_id) {
    // Target specific query loop by ID if needed
    if ($element_id === 'your_element_id') {
        $query_vars['orderby'] = 'menu_order';
        $query_vars['order'] = 'ASC';
    }
    
    return $query_vars;
}, 10, 3);

Troubleshooting Common Issues

Posts Not Displaying in Correct Order

Problem: Posts appear in date order instead of menu_order

Solution:

  • Double-check that "Menu Order" is selected in Query settings
  • Verify Order is set to "ASC" not "DESC"
  • Clear Bricks Builder cache and browser cache
  • Confirm posts have different menu_order values in the database

Checking menu_order Values

To verify your menu_order values in the database:

function check_menu_order() {
    $posts = get_posts(array(
        'post_type' => 'your_post_type',
        'posts_per_page' => -1,
        'orderby' => 'menu_order',
        'order' => 'ASC'
    ));
    
    foreach($posts as $post) {
        echo $post->post_title . ' - Menu Order: ' . $post->menu_order . '<br>';
    }
}

Multiple Sorting Parameters

If you need to sort by menu_order AND another field:

$args = array(
    'post_type'      => 'your_post_type',
    'posts_per_page' => -1,
    'orderby'        => array(
        'menu_order' => 'ASC',
        'date'       => 'DESC'
    )
);

Best Practices

1. Always Use menu_order for Manual Ordering

When you want full control over post order, menu_order is the WordPress standard and works seamlessly with Meta Box and Bricks Builder.

2. Set Posts Per Page to -1

When displaying a manually ordered collection, you typically want to show all items, not paginate them.

3. Use ASC Order

Ascending order ensures the first item you dragged to the top (menu_order = 0) appears first.

4. Clear Caches After Reordering

Bricks Builder caches queries for performance. After reordering in Meta Box, clear:

  • Bricks cache (Bricks > Settings > Performance)
  • WordPress object cache (if using Redis/Memcached)
  • Page cache (if using WP Rocket, LiteSpeed, etc.)

5. Test with Different Post Types

If you have multiple post types with reordering, ensure each query targets the correct post type.

Advanced Scenarios

Combining Taxonomies with menu_order

$args = array(
    'post_type'      => 'portfolio',
    'posts_per_page' => -1,
    'orderby'        => 'menu_order',
    'order'          => 'ASC',
    'tax_query'      => array(
        array(
            'taxonomy' => 'portfolio_category',
            'field'    => 'slug',
            'terms'    => 'web-design'
        )
    )
);

Dynamic Query Based on Current Post

For related posts using menu_order:

$current_category = wp_get_post_terms(get_the_ID(), 'your_taxonomy');

$args = array(
    'post_type'      => 'your_post_type',
    'posts_per_page' => 5,
    'orderby'        => 'menu_order',
    'order'          => 'ASC',
    'post__not_in'   => array(get_the_ID()),
    'tax_query'      => array(
        array(
            'taxonomy' => 'your_taxonomy',
            'terms'    => $current_category[0]->term_id
        )
    )
);

Meta Box Extensions for Reordering

MB Admin Columns

The MB Admin Columns extension provides the drag-and-drop interface for reordering. It automatically updates the menu_order field when you reorder posts.

Features:

  • Visual drag-and-drop interface
  • Works with any post type
  • Updates menu_order automatically
  • No additional configuration needed

Meta Box AIO

If you have Meta Box AIO (All-in-One), the reordering feature is already included.

Common Use Cases

1. Team Members

Display team members in organizational hierarchy rather than alphabetically or by date.

2. Portfolio Projects

Showcase your best work first, regardless of when it was published.

3. Service Listings

Prioritize featured services or arrange them by importance.

4. Product Showcases

Manually curate product display order for marketing campaigns.

5. Testimonials

Feature your strongest testimonials at the top.

Performance Considerations

Querying by menu_order is efficient because:

  • It's an indexed column in the wp_posts table
  • No meta queries or joins required
  • Faster than ordering by custom fields
  • Native WordPress functionality

Conclusion

Querying reordered Meta Box posts in Bricks Builder is straightforward once you understand that Meta Box uses WordPress's native menu_order field. Simply set your Query Loop to order by "Menu Order" in ascending order, and your posts will display exactly as you arranged them.

The key takeaways:

  • Meta Box stores reordering data in the menu_order database column
  • In Bricks Builder, select "Menu Order" as the orderby parameter
  • Set order to "ASC" for ascending (first dragged item appears first)
  • Clear caches after reordering posts
  • Use custom queries for advanced scenarios

With this knowledge, you have complete control over how your content displays, creating better user experiences and more effective WordPress websites with Bricks Builder and Meta Box. For a related Meta Box technique, see my post on displaying Meta Box fields in a repeater.

Additional Resources

Need help with custom queries or web development in Bricks Builder? I offer WordPress development services covering Bricks, Meta Box, and custom post type setups — feel free to get in touch.

FAQ

Does Meta Box store drag-and-drop order in `menu_order` or a custom meta field? Meta Box uses WordPress's native `menu_order` column in the `wp_posts` table — not a custom meta field. That means you don't need a meta query to retrieve the order. Just set `orderby` to `menu_order` and `order` to `ASC` in your Bricks Builder Query Loop settings or `WP_Query` arguments.
Why do my Meta Box reordered posts still display in the wrong order in Bricks Builder? The two most common causes are: (1) "Order By" is not set to "Menu Order" in the Query Loop settings, or (2) the order is set to "DESC" instead of "ASC". Lower `menu_order` values appear first in ascending order. Also clear the Bricks Builder cache after reordering — Bricks caches query results and won't reflect the new order until the cache is cleared.
Do I need MB Admin Columns or Meta Box AIO to use the drag-and-drop reordering feature? Yes. The drag-and-drop reordering interface in the WordPress admin list view is provided by the MB Admin Columns extension, or Meta Box AIO which includes it. Once enabled, dragging posts in the admin list automatically updates the `menu_order` value for each post — no additional configuration needed.

Work with me

Found this helpful?

Get in touch if you need help with your website, SEO, or paid advertising — I offer a free initial consultation.