Created
January 11, 2016 18:02
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
hi
Avg is calculated for form id based, so you can not use for all forms
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
how can i make this code to cover all of my form id to be matched with certain posts