So, here I am using Boombox Theme for my community website and I wanna show "Total post reads/views" from a user, for example an A user has 10 post and has various views each post, I need the total view from all of A's post. is it possible to do it in wordpress platform? since what i found in my database tables, i couldn't find any related field i could "play" for.
I've tried to modify an update_post_meta function, tried to add another condition on the function.php file, but it doesn't work.
here's the function:
function boombox_update_post_total_view( $scale, $post_id ) {
if( absint( $scale ) > 0 ) {
$total = intval( boombox_get_post_meta( $post_id, 'total_views' ) );
$total += $scale;
update_post_meta( $post_id, 'total_views', $total);
}
}
add_action( 'boombox/view_total_updated', 'boombox_update_post_total_view', 10, 2 );
and here's the database table structure: database table structure
thank you. NB: I don't even sure that I edited the correct file.