Created
November 9, 2017 16:24
-
-
Save n7studios/34db0bbdb39f4be02217717c6b9f3cbe to your computer and use it in GitHub Desktop.
Comment Rating Field Pro Plugin: Manually Display / Output Post Rating: https://www.wpzinc.com/documentation/comment-rating-field-pro-plugin/developers-manual-post-rating-output/
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
<?php | |
/** | |
* For developers who want to display a Post's rating in a specific place, and do not wish to | |
* use Shortcodes, the below code can be used. | |
* | |
* There must be a Field Group configured at Comment Rating Field Pro > Field Groups to display | |
* rating fields for the Post Type of the Post ID specified. | |
*/ | |
if ( function_exists( 'display_average_rating' ) ) { | |
display_average_rating( array( | |
'enabled' => 2, | |
'displaystyle' => 'grey', | |
'displayaverage' => 2, | |
'averageratingtext' => 'Average Rating:', | |
'displaytotalratings' => 1, | |
'totalratingsbefore' => 'From:', | |
'totalratingsafter' => 'Ratings', | |
'displaybreakdown' => 1, | |
'displayratingnumber' => 1, | |
'filtercomments' => 1, | |
'displaylink' => 1, | |
'id' => 100, | |
'cssID' => 'my-custom-html-id', | |
'cssClass' => 'my-custom-html-class', | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment