1. Use the do_shortcode function to use the shortcodes in your code.
For example:
<?php
echo do_shortcode('[site_reviews pagination=true assigned_to=post_id]');
2. Please see:
https://ww.wp.xz.cn/support/topic/score-count-up-to-10-instead-of-5/#post-12266247
https://ww.wp.xz.cn/support/topic/score-count-up-to-10-instead-of-5/#post-12358027
-
This reply was modified 6 years, 3 months ago by
Gemini Labs.
thank you for reply, but when i use this code i get “There are no reviews yet. Be the first one to write one.”
can you help me with code for stars, and code for reviews numbers, and code for rating?
thank you
Please read the Site Reviews > Help > Shortcodes page. This page shows each of the three available Shortcodes and explains all of the available options.
Thank you very much,
but i when i use
<?php echo do_shortcode(‘[site_reviews_summary assigned_to=”post_id” hide=”bars,rating,summary”]’);
to get rating score, i get a lot of html codes, i need only the score number.
thank you
All the shortcodes generate HTML.
If you only want the average rating of the summary as a number, you can do this in your PHP code:
$averageRating = do_shortcode('[site_reviews_summary assigned_to=post_id hide=bars,summary,stars]');
echo trim(strip_tags($averageRating));