Sorting and orderby
Overview
Divi Loop Extender adds sorting capabilities that are not available in the native Divi 5 Loop controls. Use these additions to sort by ACF fields (including Date Picker), custom meta keys, WooCommerce signals, or to stack multiple order rules.
Where to find it
- Open your page in the Divi 5 builder.
- Select the container using the Loop Element.
- Open the Loop tab.
- Locate Order by. All options documented here are provided by Loop Extender.
This page documents Divi Loop Extender additions only. Native Divi 5 order options (such as Publish Date, Title, ID, Random, etc.) are intentionally omitted.
Divi Loop Extender order sources
Use the Order by dropdown to choose one of the following provided options:
-
ACF field
Sort by the value stored in a specific ACF field attached to the looped posts. -
ACF date picker
Sort chronologically by an ACF Date Picker field (supports ascending for upcoming and descending for most recent). -
Custom field
Sort by any meta key saved on the post (works with ACF, Pods, or custom code) using the key you provide. -
Multiple order by
Apply stacked sorting. Define a primary and a secondary rule (e.g., “Menu order, then Title”). -
WooCommerce: Newest / Best selling / Highest rated / Most reviewed / Price low to high / Price high to low / % discount
Use commerce-aware signals when looping products.
Settings (Loop Extender only)
Setting | When it appears | What it does | Notes |
---|---|---|---|
Order | Always | Sets direction for the current rule. | Ascending or Descending. |
ACF field | Order by = ACF field | Select the ACF field used for sorting. | The field must exist on all items for predictable results. |
ACF field type | Order by = ACF field | Tells Loop Extender how to compare values. | Choose Text/String or Number to match field data. |
ACF date picker field | Order by = ACF date picker | Select the ACF Date Picker to use. | Ensure consistent date format across items. |
Meta key | Order by = Custom field | Enter the exact meta key name to sort by. | Example: featured_priority . |
Sort type | Order by = Custom field | Choose how values are compared. | Alphabetical or Numeric. |
Order by field 1 | Order by = Multiple order by | Primary rule. | Supports native and Loop Extender sources. |
Direction 1 | Order by = Multiple order by | Direction for primary rule. | Ascending or Descending. |
Order by field 2 | Order by = Multiple order by | Secondary tiebreak rule. | Optional but recommended for stable ordering. |
Examples
Sort posts by an ACF number field (highest first)
- In Loop > Order by, choose ACF field.
- Set ACF field to your field (e.g.,
rating score
). - Set ACF field type to Number.
- Set Order to Descending.
Upcoming events by ACF date picker
- In Loop > Order by, choose ACF date picker.
- Select your date field (e.g.,
event start date
). - Set Order to Ascending to show the soonest event first.
Custom meta key with numeric sort
- In Loop > Order by, choose Custom field.
- Enter Meta key
priority score
. - Set Sort type to Numeric and Order to Descending.
Multi-criteria: manual order, then title
- In Loop > Order by, choose Multiple order by.
- Set Order by field 1 to Menu order and Direction 1 to Ascending.
- Set Order by field 2 to Title (Ascending) for stable alphabetical ties.