I’m using Disqus WordPress plugin. When the page is not fully loaded yet, there’s only comment count but after that Disqus auto appends the string Comments to that which looks really ugly.
From the theme:
<div class="comment-bubble">
<a href="<?php the_permalink(); ?>#comments" class="comments-link"><?php comments_number('0', '1', '%'); ?></a>
</div>
I couldn’t figure out what went wrong.
Not sure how it’ll behave with Disqus, but try the following filter:
The original return is
$output
, and instead we are returning only the number of comments. That filter happens in the following core function, reproduced here if you want to adapt the previous filter hook:Related: Where to put my code: plugin or functions.php?
Basically it’s just a request using the WP HTTP API using its functions. Something along the lines of:
Details for such requests can be found on the Disqus homepage.