Skip to content

Instantly share code, notes, and snippets.

@manchumahara
Created January 11, 2016 18:02
Show Gist options
  • Save manchumahara/83829ebb2017440d874c to your computer and use it in GitHub Desktop.
Save manchumahara/83829ebb2017440d874c to your computer and use it in GitHub Desktop.
CBX Rating & Review - Showing avg rating for post id (or multiple id) http://wpboxr.com/cbx-multi-criteria-rating-review-system-documentation
//write this code in wordoress loop, if you don't understand what is loop in wordpress then please see it here https://codex.wordpress.org/The_Loop
if(function_exists('standaloneSinglePostRatingSummary')):
global $post; //if you are using this outside of wordpress loop then comment this
$form_id = 1; //asign form id as you need.
$post_id = $post->ID; //if you are using this outside of wordpress loop then set the post id as it need , example $post_id = your post id here ;
$option = array(
'form_id' => array($form_id),
'post_id' => array($post_id)
);
echo standaloneSinglePostRatingSummary($option);
endif;
@marcussportsilo
Copy link

how can i make this code to cover all of my form id to be matched with certain posts

@manchumahara
Copy link
Author

hi

Avg is calculated for form id based, so you can not use for all forms

@marcussportsilo
Copy link

is there a way i can add the actually average rating score next to the stars..

example ***** (3.5/5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment