Hello @onno454,
That information is not stored in the database.
[testimonial_count] counts all the published testimonials and displays the number.
And testimonial_average_rating takes all the testimonials that have a rating and calculates the average.
All the best,
Mihaela
Thanks Mihaela
When using do_shortcode in PHP it shows the value, but also HTML div’s/span’s.
Is there a way to get rid of this HTML to keep only the value, is there maybe a global variable for the count & average that I can use? or another way?
Thanks again!
Hello @onno454,
[testimonial_count] should only display only the value, without any other tags.
If it does then please try [testimonial_count unformatted]
And for [testimonial_average_rating] you can use this filter:
<?php
function wpmtst_average_rating_pre_html_filter( $html, $atts, $summary ) {
return $summary['rating_average'];
}
add_filter('wpmtst_average_rating_pre_html', 'wpmtst_average_rating_pre_html_filter', 10, 3 );
And it will only display media without other html.
All the best,
Mihaela
Thank you Mihaela!
Works flawless. You’re the greatest!
Happy to hear it works, @onno454!
Rock on,
Mihaela