Adding Numbers from Custom Fields from Multiple Post Types
-
I have a question for those of you talented in PHP + custom fields + post types.
I’m trying to add specific custom fields from numerous posts and display a total. Let’s say we have a post type called “items” and a custom field for each called “price”. I need to add the prices and display them on a different landing page. How do I grab these custom fields and add them together? Keep in mind, there are dozens of posts that are constantly changing, so it needs to be an automatic way to populate the total without too much manual adjusting.
Example:
Item #1 = $10
Item #2 = $15
Item #3 = $22
NEED TO OUTPUT $37 on a separate landing page.I may be overthinking this and blind to a simple solution, so any help would be greatly appreciated!
Josh
- The topic ‘Adding Numbers from Custom Fields from Multiple Post Types’ is closed to new replies.