Hi,
how can I show just the stars representing the average rating for a post in either the single post or archive page
Thanks
Hi @jjk,
Please read this doc: https://wpdiscuz.com/docs/wpdiscuz-documentation/settings/comment-list-settings/#display_ratings
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Hi @asti,
thanks for the swift reply!
I did read that and have the options before/after post enabled, but not rating shows. I am assuming it's an effect of the theme I am using (mh-magazine), so I would like to add it manually (shortcode or else?).
Thanks,
JJ
yes @jjk, you can use wpdrating shortcode in post content to display rating average and stars.
See the example below:
[ wpdrating metakey="all" show-label=false itemprop=false ]
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
@jjk,
I'm sorry, but no documatation yet.
See the description below:
1. metakey is the value of the meta key for the rating field. If you set it "all" the total count will be displayed.
2. show-label - if you set "true" as a value of the property the "Name For Total" will be displayed, otherwise not.
3. the value of the itemprop property is being used for showing agregates. If you set it false it'll not be indexed by Google.
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
thanks for the description - sadly, it doesn't do anything for me. A post that has a rating and a comment, nothing shows with the above shortcode. I will look into it a bit more, but than probably let it go for now.
Thanks anyways for being so responsive!
after looking into this a bit, I think here might be a small bug in the code..
in the Form.php, within public function getRatingMetaHtml on or around line 950 (not sure exact as I messed around with it) the code calls the function itself again
$html = $form->getPostRatingMetaHtml($atts);
$html = $form->getPostRatingHtml($atts);
However, there is no way to only show the stars, which would be desireable for example in an archive view or as a small indicator behind a posts title. For that, I have copied the getPostRatingHtml() function to a new one getPostRatingStarsHtml() and deleted all html that isn't necessary to show only the 5 stars inline with adjacent text.


