Print sum of custom fields value if another custom field date is equal to today’s date

Question

I want to print the sum of recent 10 posts custom field value of a specific category/tag.

The recent 10 posts also have a custom field key named (Validdate), so how to print sum of the 10 posts if their Validdate CF value is equal to today’s date?

Example –
Category Id – 520

1st Custom Field Key Name – Total

Custom Field Value (Total) – 1 [Other 9 Posts CF Value 2, 3, 4, 5, 6, 7, 8, 9, 11]

2nd Category Field Key Name – Validdate

CF Value (Validdate) – 22 October 2020 [For other posts CF Value 11/…/22/22 October 2020 ]

Output Should be – 20 [Because Condition is true for Last 2 Value and the recent 10 posts has called from category id=520]

0
Puneet Verma 2 years 2020-10-22T03:10:22-05:00 0 Answers 6 views 0

Leave an answer

Browse
Browse