The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Sorry, it does not work. I added your code as-is to the functions.php and it did not change the order. It still is sorting by the city only on this page - hidden link.
Shane, please confirm. You're saying now that we can only sort by one custom field? Is that because I am using Advanced Custom Fields, or would that same limitation be true even if I was using WP Types Custom Fields?
Okay, then I guess I am not clear when you there was no field with name acf_directory_sort_order. It is on the Provider custom post type as you can see here - hidden link. And it can be seen here ACF Field Group called "Directory Listing Information" - hidden link.
So, where is it you are seeing the field? It was added later, so maybe some records don't have it recorded in the database record, but the field is definitely there.
So, why would it be working on your test site and not on my test site? I've added the code to functions.php in the child theme. Then I went to a state with a smaller sampling than Florida, in this case Nevada - hidden link. And I made sure to update something on each of those records so for sure the custom order field would be saved in the database. And I changed the first record on the page to have a sort value of 200, so it should go to bottom since all others have a sort value of 100. But the record did not go to the bottom.
Interesting. I do now see it is working on that page - hidden link. That page is not actually one I use because I don't want to present ALL the providers. So, hence I am using this URL_PARAM that is grabbing a smaller group (in this case a single state) - hidden link. That is where it is not working, but where I need it to work.
We are so close, and I really appreciate your help on this.
This is very strange. I went to the dev site sample page to test and it actually sorted the way I wanted. I tried two different states hidden link hidden link
And that was without changing the ID. If I changed the ID then the order seems totally random. So, then I copied the code onto the functions.php of the live site. But it did not work. Did I need to do something in addition to the just the code on functions.php? Even after clearing cache it didn't work.