-
brendenjones
I have 2 custom post types (staff, testimonials) with an AFC relationship. Testimonials are displayed on the staff page using a Query block using the Query Type of Post Meta. By default the oldest testimonials are displayed first, but I want to display the newest testimonials first. However, there is no ‘Add Parameter’ button for the Post Meta Query Type.
Can the Add Parameter button be added? Or is there another solution?
-
Hi there,
By default, when you retrieve posts from an ACF Relationship field, WordPress respects the order in which they are stored in the field (
post__in
order).So no, when the query type is set to post meta, it respects the order of posts in the field.
The only workaround I can think of is to set the query type to Post query, and use PHP code to pull the posts from ACF field.
-
brendenjones
Bummer, that severely reduces the functionality of retrieving posts from an ACF Relationship field. I assume the answer is no, but is there a way to at least reverse the order of the posts?
-
Alvind
Hi there,
Right now, the only solution is to use the workaround suggested by Ying. I believe custom parameters for Post Meta query are planned, or at the very least, a filter should be available for it. I’ll check with the dev team.
-
brendenjones
Thank you Alvind! That would be great if custom parameters are planned or if a filter was a possibiliy!
-
Alvind
You’re welcome! I’ll update this topic as soon as we have any new information on that.
- You must be logged in to reply to this topic.