Can I get a posts rating the same way I can get any custom fields value?
-
Hello Blaz,
I’m planning on using your star rating on each item of a list of custom posts; The plan is to just show the exact average rating, no stars or anything, next to the post titles. Then when you click to show the full post, you’d see the usual rating results along with the rating widget further down.
I assume this value is stored somewhere for each item, but I also have a feeling you’re not storing it within the posts (unlike custom fields, etc).
It would be great if it was possible to use something like this:
if(get_average_rating()) { echo get_average_rating(); }
That would to me, make this plugin a solid 5/5.
Edit: I tried to place the shortcode for the rating resuts within the post query (in a template part more specifically) but it seems like you can only have this shortcode in 1 place in the DOM. Otherwise the rating doesn’t show. The plan was then to remove the stars with CSS.
- The topic ‘Can I get a posts rating the same way I can get any custom fields value?’ is closed to new replies.