• 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.