Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts
add_shortcode( ‘show_total_listing_price’, ‘show_total_listing_price’ ); function show_total_listing_price ( $atts ) { global $post; $args = array( ‘author’ => get_current_user_id(), ‘post_type’ => ‘POST_TYPE_GOES_HERE’, ‘posts_per_page’ => -1, ‘post_status’ => ‘publish’, ); $query = new WP_Query( $args ); $total = 0; if( $query->have_posts() ){ while( $query->have_posts() ){ $query->the_post(); $price = get_post_meta( $post->ID, ‘PLACE_META_KEY_HERE’, true ); $total += $price; } … Read more