Skip Navigation

[Resolved] Can I sort values highest to lowest within custom post types?

This support ticket is created 4 years, 7 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 4 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1340709

Tell us what you are trying to do?
I'm using Gravity Forms. A user indicates their priority of 4 things 1-4 on a likert scale of 1-5. I can calculate the percentage values for each of the 4 properties an save to a Types custom field. Is there a way to then query those fields and determine the order from a numerical order?

Here's an example:
A user decides what is most important to them: Food, Clothing, Shelter, Transportation.
They provide an oder of 1-10 of how important each is.
I calculate the total points awarded and then award a percentage for each (food, clothing, shelter, transportation) and save the value to a custom field.

Now, what I want to do is say, given a pre-determined order of "clothing, shelter, food, transportation', I want to find which person who has taken this survey best meets my expectations. I feel like I'm so close to figuring this out but just can't quite get it. Is this doable?

Is there any documentation that you are following?
Not really, I can't find anything like this.

Is there a similar example that we can see?
Not currently.

What is the link to your site?
hidden link

#1340793
Ordering.JPG

Hello,

I assume we are talking about this case:
1) After user submit the Gravity Form, you can save a value into custom field "total points",
2) You are going to do this:
a) Create a post view
b) sort the results by value of custom field "total points".

If it is, it is possible within Toolset Views plugin, you just need to create a post view:
- Query your custom posts
- Sort the result by custom field "total points", see screenshot: ordering.JPG

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.