Title: Using php math operators in auto template
Last modified: June 11, 2019

---

# Using php math operators in auto template

 *  Resolved [siteprowizard](https://wordpress.org/support/users/siteprowizard/)
 * (@siteprowizard)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/using-php-math-operators-in-auto-template/)
 * I am looking to see how I can use simple math operators to average 3 different
   fields in a single ID (post) of a pod – as it would be in the auto template of
   a single post – custom post type
 * I know php works in the templates (though deprecated). But would use a pods plugin
   if I could figure out how to make that work through the auto template.
 * I have tried several different ways of referencing the fields in php but the 
   result is always empty.
 * Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Jim True](https://wordpress.org/support/users/jimtrue/)
 * (@jimtrue)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/using-php-math-operators-in-auto-template/#post-11627966)
 * You can not do math against the fields without loading them into variables and
   calculating with PHP. That is not supported in Pods Templates.
    -  This reply was modified 6 years, 12 months ago by [Jim True](https://wordpress.org/support/users/jimtrue/).
 *  Thread Starter [siteprowizard](https://wordpress.org/support/users/siteprowizard/)
 * (@siteprowizard)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/using-php-math-operators-in-auto-template/#post-11628697)
 * Ok, thanks Jim
 * So, any way to do what I need to do? – take field values for a single post and
   average them?
 * Like I mentioned, am familiar with pods simple plugin – but not sure how to get
   it to just function when that particular auto template runs
 *  Plugin Contributor [Jim True](https://wordpress.org/support/users/jimtrue/)
 * (@jimtrue)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/using-php-math-operators-in-auto-template/#post-11631947)
 * What you’re attempting to do, you would have to do with PHP, so you could not
   do it within an Auto Template.
 * You could call a function against the post ID, like `{@ID,calc_some_math}`, but
   all loading of Meta and the math within, you need to write yourself. That’s out
   of scope for our support. It only gets the post ID as parameter and only has 
   one return (which could be your string), so everything else is on you.
 * Here’s the relative doc page for Output Filters with magic tags: [https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/#Using_Functions_On_Field_Output](https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/#Using_Functions_On_Field_Output)
 * It’s up to you to be creative with how you use those.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using php math operators in auto template’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

 * [template](https://wordpress.org/support/topic-tag/template/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jim True](https://wordpress.org/support/users/jimtrue/)
 * Last activity: [6 years, 12 months ago](https://wordpress.org/support/topic/using-php-math-operators-in-auto-template/#post-11631947)
 * Status: resolved