How to get max value of filtered query post

Question

I have a query post to filter my post in my CPT, filtered on front end by a form filter.

The problem is that with different filter, I have different max value.

For example I have the following custom field meta value:

  • filter #1 – Ford, Nissan, Toyota
  • filter #2 – Blue, Red, White
  • and on with other filter#3, #4 etc…

Choosing different filter (for example ‘Ford and Red’ vs ‘Nissan and White’), I may have different max value price of total cars in the same query post, that have the same characteristics.

How I can get the max value of current filter on query post, and use this value on each line of same query post to show the different price from the max?

Someone can help me?
Thanks in advance

0
Giulio 4 months 2021-03-21T06:53:01-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse