Function to view counts


#1

Hello,

I take a look at the doc for showing like / count and comment but i have a problem with this function

function rtmedia_get_media_view_counts_custom( $media_id = false ) { global $rtmedia; $options = $rtmedia->options; $counts = 1; if ( isset( $options[ ‘general_viewcount’ ] ) && ( $options[ ‘general_viewcount’ ] == “1” ) ){ $counts = get_rtmedia_meta( $media_id, ‘view’ ); } if ( $counts != 0 ) { return $counts; } else { return ‘1’; } return $counts; }

$options[ ‘general_viewcount’ ] always return 0 for all my picture so i think it’s because of that that i can’t display my view count. isn’t it ?

Thank you


#2