I have a ratings button in WordPress that outputs the number of people who rated the post. Is it possible to add the Ajax functionality so it doesn't refresh the whole page just the button number?
Thank You in advance :)
I'll only outline how to do it since there are plenty of answers on this site that address how AJAX works in WordPress. Just check out the ajax tag.
This triggers one of two hooks:
(see this answer). You can hook onto those with a function that takes the sent post ID, performs nonce checks and user permissions etc, and adds the rating (I assume this is like a 'like' button - else you'll want to send the rating too).
Once it's processed you can then