Saltar navegación

[Resuelto] Maximum custom field value in JS

This support ticket is created 3 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
- 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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por fahimS-2 3 years ago.

Asistido por: Minesh.

Autor
Mensajes
#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
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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.
- enlace oculto

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!