Title: Executing PHP function within [each] tags
Last modified: February 17, 2021

---

# Executing PHP function within [each] tags

 *  Resolved [willythewhale](https://wordpress.org/support/users/willythewhale/)
 * (@willythewhale)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/)
 * I have a function to navigate between custom post types. I want to have more 
   the so for when I am listing mutliple items from the same field, I can have next
   and previous links for all people listed. For example, this is how it would theoretically
   look:
 * [each author]
    {@author_name} Next by {@author_name} Previous by {@author_name}[/
   each]
 * The function however has to have multiple fields passed to it.

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

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14069241)
 * Hi [@willythewhale](https://wordpress.org/support/users/willythewhale/)
 * You can pass the value through a function by adding it to the magic tag after
   a comma, like so:
    `{@field_name,function_name}` Though this notation you can
   create your own functionality.
 * Cheers, Jory
 *  [ozonia](https://wordpress.org/support/users/ozonia/)
 * (@ozonia)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14139790)
 * Hi Jory (@keraweb)
    Pods is a fabulous plugin. Thanks! I would like to know how
   I can do a simple calculation with values ​​of two fields from my pods. For example,
   I have a custom Pods called “Courses” that has a price field and an offer (%)
   field and I want to show the value resulting from calculating the value of the
   discount on the screen. Can hoy help me? Thanks and regards.
    -  This reply was modified 5 years, 2 months ago by [ozonia](https://wordpress.org/support/users/ozonia/).
    -  This reply was modified 5 years, 2 months ago by [ozonia](https://wordpress.org/support/users/ozonia/).
    -  This reply was modified 5 years, 2 months ago by [ozonia](https://wordpress.org/support/users/ozonia/).
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14140486)
 * Hi [@ozonia](https://wordpress.org/support/users/ozonia/)
 * First off, please open a new topic if you have a new question.
 * In your case you’ll need to create a PHP function that calculates this, two doc
   pages that might help:
    [https://www.php.net/manual/en/language.operators.arithmetic.php](https://www.php.net/manual/en/language.operators.arithmetic.php)
   [https://www.php.net/manual/en/ref.math.php](https://www.php.net/manual/en/ref.math.php)
 * Cheers, Jory
 *  [ozonia](https://wordpress.org/support/users/ozonia/)
 * (@ozonia)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14140541)
 * Thanks !!
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14159564)
 * You’re welcome! The best way to say thanks is to leave a 5 star review at [https://wordpress.org/plugins/pods/](https://wordpress.org/plugins/pods/)
   and (if you’re feeling especially generous) become a Friend of Pods at [https://friends.pods.io/](https://friends.pods.io/)
 * Cheers, Jory

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

The topic ‘Executing PHP function within [each] tags’ 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

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

 * 5 replies
 * 3 participants
 * Last reply from: [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/executing-php-function-within-each-tags/#post-14159564)
 * Status: resolved