function comm_rating_display_average_rating() {
global $post;
$stars = '';
$average = comm_rating_get_average_ratings( $post->ID );
for ( $i = 1; $i <= $average + 1; $i++ ) { $width = intval( $i - $average > -1 ? 20 - ( ( $i - $average ) * 20 ) : 20 );
if ( 0 === $width ) {continue;}
$stars .= '<span style="overflow:hidden; width:20px" class="dashicons dashicons-star-filled"></span>';
if ( $i - $average > 1) {
$stars .= '<span style="overflow:hidden; position:relative; left:-' . $width .'px;" class="dashicons dashicons-star-empty"></span>';
}
}
$custom_content = '<span class="rait"><span><div class="all_com_pr">' . $average .' ' . $stars .' </div></span></span>';
echo $custom_content;
}