Passer la navigation

[Résolu] Maximum custom field value in JS

This support ticket is created Il y a 3 years. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par fahimS-2 Il y a 3 years.

Assisté par: Minesh.

Auteur
Publications
#2608101

I have a JavaScript code which I am using in my Toolset Archive. Now I need the maximum value of a custom field from all the posts of a custom post type. After obtaining the maximum value, I will use it in my JS code. Is there any way I can get the maximum value?

#2608153

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

This is pure PHP/WordPress question.

I suggest you should search google about how you can return the max value from the custom field for post type.
- lien caché

One way to do this in Toolset is to create a View for your post type , ordered by your custom field descending, and limited to 1 result and return whatever value you want to show in loop editor.

#2610133

My issue is resolved now. Thank you!