Title: Totaling Custom Fields
Last modified: August 20, 2016

---

# Totaling Custom Fields

 *  [John](https://wordpress.org/support/users/jsing/)
 * (@jsing)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/totaling-custom-fields/)
 * Here is a tricky one… i think. My desire it to use WP to do a little accounting.
 * I have added a custom post type called ‘Asset’. It has a custom field named ‘
   Amount’. There is a custom taxonomy called ‘Type’. Lets say the Assets can be
   in 1 of 5 Types. I am trying to devise a way to do a couple things.
 * 1. On the single-asset.php I would like to get a sum of all the Amounts of all
   Assets that are in the same Type as the current Asset. So if the current post
   is Type 3 i want the page to display a total of all Type 3 Amounts.
 * 2. If possible I would like to subtract that number from an Amount stored another
   post type called ‘Sources’. The common factor could be that the Source Post Title
   and the Type are exactly the same, say 3.
 * 3. Get the total of all Amounts for each Type as a list.

The topic ‘Totaling Custom Fields’ is closed to new replies.

## Tags

 * [addition](https://wordpress.org/support/topic-tag/addition/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [custom taxonomy](https://wordpress.org/support/topic-tag/custom-taxonomy/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [John](https://wordpress.org/support/users/jsing/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/totaling-custom-fields/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
