How to order / sort a Query for Meta Value?

Hi, I have a ACF Relationship field with multiple entries that I am querying. Which Meta Key do I have to use to sort that query for it to be sorted in the order of the ACF Relationship?


Hi @T-low,

We have included the “Post In” option for the Order By parameter in which should allow you to keep the ACF Relationship order.

Please let me know if this helps.


1 Like

Thank you @Louis works perfect with :+1:

I’m not sure if this should even be possible, but the order option is still visible.
At the moment the ascending and descending options don’t change the order of the ACF Relationship.


@T-low is this still working for you?

Post In doesn’t seem to be reflecting the Relationship order for me, so just trying to figure out if it’s a bug or if I’m doing something wrong.

Hi @sunny,
this still works for me :+1:

Cwicly Version
Used with ACF Relation on same Page

1 Like

Thanks for sharing those screenshots. I was including my ACF field in the Meta Query section instead of in the Posts section. I wonder if that could be why.

A while back I had that too until I realized that it was dynamic data :sweat_smile:

I think the Meta Query section is for further filtering, for example if the doctor was retired true/false and use that to not display retired doctors. But this is without warranty as I just got to know slightly what meta values are and I am still not familiar enough with the whole querying :joy:

1 Like

Looks like that was it.

Setting the query like this works, but not if you want to use the Post In sorting - which actually makes sense now that I think about it.

Doing it this way includes all posts, and then filters some out. It isn’t explicitly specifying which posts to include, and thus sorting by Post In has no effect.

Thanks again for the screenshot @T-low.