wp-postratings
wp-postratings copied to clipboard
Using a shortcode in a query loop results in incorrect display.
WIth Full Site Editing themes like the WordPress default theme Twenty Twenty-Four, it would be nice to be able to use this plugin inside query loops.
When I attempted to do this, I got buggy behavior, in that all posts on the archive page show the value of the first post displayed.
Here's my setup so that you can try to reproduce it:
On my archive page, I have a query loop. Inside the query loop, I use the shortcode method to include display the ratings:
This creates a display. As noted above, please note that the rating count is incorrectly displayed as the same for all three posts.
Please note that the second post on the list shows a different number when viewed on a post page. The post page is the correct value.
Same thing, how did you solve this problem?
@vladossipov
Unfortunately no. I haven't found a fix so have removed the ranking from the query loop for now.
I wondered if I used WPCode to create a custom shortcode if I could make it work. But I haven't spent the time on this project.