Tell us what you are trying to do? I have a projects list with a start date for each project in custom Type. i want to display the average energy savings for each minute for all projects combined. So one project started on May 1, 2021 and had an energy savings of "2" per day and another may be Jan 1, 2019 with a savings of '3". I want to calculate the number of minutes from the start date to current date then multiple it times the savings foor each project, then add them all up for one total. What do you recommend?
Is there any documentation that you are following? No
Is there a similar example that we can see? No
What is the link to your site? hidden link
Hello,
There isn't such kind built-in feature, you might consider custom codes, for example:
1) Create a custom shortcode with custom PHP function
https://developer.wordpress.org/reference/functions/add_shortcode/
2) In this custom PHP function, get the timestamp value from custom date field "start date":
https://developer.wordpress.org/reference/functions/get_post_meta/
Calculate the result, and output it as what you want:
One thing need to pay attention, if the custom date field is created with Toolset Types plugin, you need to add prefix "wpcf-" before the field slug, for example, if your custom date field is using slug "my-date-field-slug", you can get it's value like this:
$my_date = get_post_meta(get_the_ID(), 'wpcf-my-date-field-slug', true);
More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/
when you are accessing custom fields through native WordPress functions, you need to prepend the wpcf- prefix to the slug. Continuing from the above example, for native WordPress function to access the “House Price” field, you need to use the wpcf-house-price slug.