Skip Navigation

[Resolved] Items in a repeating field group cannot be sorted by View

This thread is resolved. Here is a description of the problem and solution.

Problem:

A client created several Repeating Field Groups (RFGs) and used separate Views to display each group. However, the items inside each RFG always appeared in the same fixed order regardless of the View’s “Order by” settings or adjustments to menu order in the backend. The client expected RFG items to sort by menu order like repeating fields but sorting had no effect.

Solution:

RFG items are stored as child posts, so WordPress does not use menu order for them. To control ordering, the View must sort by a custom field that exists inside the RFG itself. Adding a numeric “order” field (or similar) to the RFG and selecting Order by → Field in the View (choosing that field) allows proper sorting.

Relevant Documentation:

https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by charlesR-4 3 weeks, 1 day ago.

Assisted by: Christopher Amirian.

Author
Posts
#2836277

I have created several repeating field groups. I have built a View to display each of them individually. However, no matter what option I choose in the View for the display order, nothing changes. They appear to be displaying in a set random order.

Example:
At the bottom of this page: hidden link
Under the "Artists" heading at the bottom are two repeating field groups, one for the actors (with photos), the other for crew. Each one is displayed using a different View.

The crew listing should be in the order: Director, Choreographer, Craft Services (that is the menu order in the backend).
I have tried changing the item ordering on the post interface, as well as the "Order by" parameter in either of those Views. Nothing I do will change the order that either of the items in each group are displayed.

#2836459

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support.

If I understood correctly, repeating Field Groups (RFGs) ignore View ordering because the items are stored as child posts, and WordPress returns them in the order they are stored unless you explicitly sort by a field inside the RFG.

In your View, set Order by → Field and choose a custom field that exists inside the RFG (for example “position”, “order”, or any numeric field you add for sorting).
Sorting cannot use “menu order” for RFGs — this is expected.

Thanks.

#2836482

I understand. I have used repeating fields before, and those can be sorted by menu order, so I assumed that would also be the case for repeating field groups. Thank you for the insight.