Support

Account

Home Forums Front-end Issues Find Sum of Custom Field Values from Different Posts Reply To: Find Sum of Custom Field Values from Different Posts

  • One of the answers on this page explains how to do this http://wordpress.stackexchange.com/questions/9394/getting-all-values-for-a-custom-field-key-cross-post, it’s the last one on the page right now posted by toscho

    The problem with the his however, as that poster says, there isn’t any way to not get values from revisions, trash, or all other types of posts.

    The only way to do this accurately it do use WP_Query to get all of the posts in your post type, loop through them to get all of the values and then add them together.