How to add together (get the sum) a field from all author’s posts
First you have to declare the global $wpdb before using it. Also you need to include the table prefix when calling the table names. global $wpdb; $posts_table = $wpdb->prefix . “posts”; $posts_meta_table = $wpdb->prefix . “postmeta”; Next get an array of post ids by the author needed( make sure you have the id of desired … Read more