surveywp / kk-star-ratings

kk Star Ratings wordpress plugin
https://wordpress.org/plugins/kk-star-ratings
Other
119 stars 44 forks source link

Hi, can you show data schema.org also in Archive/Category page please? #128

Closed enric34 closed 1 year ago

enric34 commented 1 year ago

I don't know if it is a bug or the plugin don't have this functionality. What i'm asking is: Is it possibile to put Stars in archive pages?

In the settings of the plugin there is the option "Archive page" , but when i open an archive page on wordpress there aren't stars into the archive page, so i put manually the shortcode "[kkratings]" in the archive page, then I can see stars only visually but not into html code.

Is it possibile to add this functionallity? Thanks very much

Example: IMPLEMENTATION THAT I NEED (I can pay): Archive page with Shortcode "[kkratings]" inserted: URL: https://toptapisroulant.it/high-power/ Image: https://ibb.co/mypY47f Schema.org: nothing appear in html code

Blog post works, auto insert stars and into html code:

URL: https://toptapisroulant.it/news/tapis-roulant-portata-130-kg/ Image: https://ibb.co/DgDgLcN Schema.org: works ok CreativeWorkSeries

Thanks

kamalkhan commented 1 year ago

If the theme/template file which renders the archive page uses excerpt instead of full post content, the star ratings won't be visible. That's how it is implemented in the plugin.

Let me know if that's not the case for you.

enric34 commented 1 year ago

I think I use excerpt. Can you give to me the code to put in the function php of child theme please?

Can you give me the code that activate the rating on the excerpt?

Thanks

kamalkhan commented 1 year ago

WordPress strips/trims shortcodes so the stars aren't shown. This is why the star ratings are removed from excerpts by the plugin. To show full content in archives, you have to edit archives.php in your theme file and where it shays the_excerpt(), you should use the_content(). Your theme may however be using a different template file for displaying archives so you will have to look into that too.

enric34 commented 1 year ago

No, Stars appears Visually, "Only Visually" but not inside the HTML code. i want to print the rating of schema.org inside the json.