Skip Navigation

[Resolved] Order By Field not working

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 11 replies, has 2 voices.

Last updated by Christian Cox 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#589891
Screen Shot 2017-11-15 at 14.49.10.png

I am trying to: Sort the order of the results in an archive

Link to a page where the issue can be seen: hidden link

I expected to see: The results with a value of '9' in the is_paid_listing field should be at the top of the list. I have included the value in the front end, just so I can see what's happening.

Instead, I got: No sorting at all

When I add secondary random sorting, they all sort randomly. So it's almost as if it is ignoring the value of my selected field

#589970

Hi, I'll be glad to help get this sorted appropriately. Can you share screenshots showing the WordPress Archive editor in wp-admin, as well as the Loop Output and any Content Templates you are using to display these results? I would like to see how everything is configured so I can offer the best solution.

#589984
Screen Shot 2017-11-15 at 20.03.09.png
Screen Shot 2017-11-15 at 20.02.57.png
Screen Shot 2017-11-15 at 20.02.40.png
Screen Shot 2017-11-15 at 20.01.16.png

Hi Christian,
Some screenshots attached!

I have a conditional tag on the header, whereby if the is_paid_listing = 9 then it will show Post Title with a link. If is_paid_listing = 0, then it'll show the Post Title without a link. This is working perfectly, so it must be reading the 0 and 9 correctly, I just can't get it to sort on them.

Thanks,
J

#589989

PS - happy to give admin access if it's easier. Where can I send these details?

#589998

Sure, I have enabled private reply fields here to share login credentials confidentially.

#590002

Quick question - have you tried to modify the "Order by" options to choose "as a number" instead of "as a native custom field"? Does that have the intended effect?

#590004

I have tried that, I'm afraid.

I've also tried using a 'true/false' field type that gives values 1 or 0. I've also tried using a radio field that returns values 'paid' and 'free' and sorting by string, but I'm afraid I haven't been successful sorting on any of them 🙁

#590298

Okay thanks, I see now that your custom fields are defined by the Advanced Custom Fields plugin and not by Types. I'm able to sort a View by a radio ACF field, but unable to sort a WordPress Archive by the same ACF field. I'm reaching out to my 2nd tier support team for some clarification here. It may be the case that we are not able to use these values in a WordPress Archive order-by clause for some reason. In the meantime, one option is to create a View that sorts by this radio field and use that instead of the WordPress Archive.

Please stand by and I will update you when I have some additional information about ACF and WP Archive integration.

#591600

It appears that this field must be managed by Types in order to be used to sort an Archive. To do that, go to Types > Post Fields and click "Post fields control" at the bottom of the screen. Hover over this ACF field in the list of fields and click "Manage with Types." You should then be able to sort your archive based on this custom field. Our 2nd tier support team has escalated this to our developers as a consistency issue, and I'll keep you posted here as we work to resolve that. For now, the workaround is to manage this field with Types.

#591610

Hi Christian,
Thanks for the reply!
I can't manage this field with Types as all of my other fields are dependant on the value of it, unfortunately.
It's a field that will flag whether or not to show subsequent fields.
Do you have a time frame for looking at this?
At the moment the site is still in development, but I will need it to be functional before I launch. As the field flags if it's a paid listing, they need to appear at the top of the listings, before the free ones.
Thanks,
Jean

#596259

Unfortunately I have not yet received any timeline for delivery of the fix for this issue. I will let you know as soon as I have some more information to share.

#1193094

Hi, my 3rd-tier support team reports that this issue has been resolved. Please update to the latest versions of WordPress, ACF Pro, Types and Views and let me know if the problem is not fixed.