DYNAMIC CALCULATIONS
The Dynamic Calculations widget is a compact tool for performing arithmetic and statistical operations on numeric and date meta fields from JetEngine and ACF. It supports single values and arrays, including mathematical expressions, sum, average, min/max, and date-difference calculations. Use it anywhere a computed value is needed—listing grids, current posts, or current users.

USAGE & SCOPE
Select your data context via the Query Source control:
- JetEngine Listing Grid: Compute over values in a listing.
- Current Post: Use meta fields of the current post.
- Current User: Operate on the logged-in user’s meta.
Note: Ensure your chosen source returns numeric or date values compatible with the selected operation.
WIDGET SETTINGS
Configure the calculation, formatting, and output style.
WIDGET SETTINGS
- Query Source: Listing Grid / Current Post / Current User.
-
Operation Type:
- Math (
+ - * /
) - Sum
- Avg
- MinMax (range)
- Since hours (date difference)
- Math (
-
Meta Field Keys / Macros:
Comma-separated list of meta keys or macros (e.g.
%value1%
,%value2%
,%today%
,%current_post_date%
). Date macros accepthours
,minutes
,days
offsets. - Prefix & Suffix: Optional text before/after the result.
- Output Format:
plain
(inline) orlist
(<li> items). - Number Formatting: Strip non-digits (remove “.” thousands separators; preserve “,” decimals).
- MinMax Prefix/Suffix: Supply combined or individual prefixes/suffixes for Min and Max values.
Supported operations:
- Math
- Sum
- Avg
- MinMax
- Since
OPERATION SYNTAX Examples
Define each calculation block with this pattern:
[Operation: Math (prefix: | shuffix)] %value1% - %value2% [Operation: Math] %number_a% \* %number_b% [Operation: Sum] %val1%, %val2%, %val3% [Operation: Avg] %score1%, %score2%, %score3%, %score4% [Operation: MinMax (Min: "Low: " | suffix: " km"; Max: "High: " | suffix: " km")] %val1%, %val2%, %val3% [Operation: Since hours (prefix: "Elapsed: " | suffix: " hours")] %current_post_date% %today% You can define hours, minutes, days
EXAMPLE USAGE
Given meta fields:
distance1
: 5
distance2
: 10
distance3
: 7
[Operation: Sum]
%distance1%, %distance2%, %distance3%
Renders:
22 </code>
TUTORIAL & ADVANCED USAGE
-
Select Source
ChooseListing Grid
,Current Post
, orCurrent User
. -
Define Operation
Pick the operation type—use “Since hours” for date differences and date macros. -
Enter Keys/Macros
List your meta keys or date macros, separated by commas. -
Set Prefix/Suffix
Optionally add labels or units around your result. -
Choose Output
Plain inline text or list items. -
Enable Formatting
System will strip non-numeric characters automatically and apply locale-appropriate separators.