Sorting Dynamic Data In A Looper

Hi,

I have dynamic content coming from a looper, but I cannot seem to find a way of sorting it alphabetically.

2023-03-06_18-17-30

The looper’s content is: {{dc:acf:post_field field="casualty_memorial_casualties"}}

The field references an ACF Pro Relationship field as previously discussed in ACF Pro Bi-Directional Updates and ACF Pro Relationship Field Not Displaying

Is there a way of being able to sort the results - perhaps an ORDER BY ..... statement?

Thanks,
Christopher

Hello Christopher,

Thanks for writing in! Regretfully the dynamic content will only display the value stored in that particular data. The order is the same when the date is inserted. For example, in the ACF field “casualty_memorial_casualties”, if the items were ordered by ID, then the Looper will also return the exact order of the items.

Sorting the result in a looper may only possible if you are using a Looper Provider Query String. You may be able to change the order of the items. For example, if you have a Looper Provider Query String: post_type=post&post_status=publish

To include sorting, you can have:
post_type=post&post_status=publish&orderby=title

Best Regards.

Hi @ruenel,

Thanks for confirming what I feared would be the answer! We will have to live with unordered results. :grinning:

Thanks,
Christopher

Hi Christopher,

Regretfully, the Dynamic Content will only display the value stored in that particular data.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.