I’m trying to get the comment count on a WordPress post as a PHP variable.
For some reason comments aren’t syncing properly between disqus and WordPress so get the comment count from WordPress locally isn’t an option.
Does anyone have any ideas about how to go about this? There’s an API and PHP wrapper but I’d like to see if there’s an easier way before I get stuck into the API.
Thanks!
PS I need as a PHP variable so posts can receive an rating based on likes, favourites and comments so getting it in JS isn’t really an option.
Thanks!
I don’t think you have other options to get the data on the server side other than using the Disqus APIs.
I think that the correct API for doing this is: http://disqus.com/api/docs/threads/set/
You can understand how it works from this example in JS: http://help.disqus.com/customer/portal/articles/1131783-tutorial-get-comment-counts-with-the-api the results are the same, so it should be your code.