Disqus comment link - 'Leave a comment' rather than '0 comments'?

I want to make the comment link in the post meta work with Disqus. I found this post, which really helped: https://theme.co/forum/t/disqus-comment-count-link/55195/11

That worked, great - it counts the comments and links to the Disqus comment section. The only problem is, when there are no comments, the post meta now flashes up ‘Leave a comment’ only for a moment and then switches to ‘0 comments’.

‘Leave a comment’ is a bit more inviting and I’d rather not highlight the fact that there are ‘0 comments’ . Which is of course why you coded it that way for the WordPress comments.

What code do I need to get the same behaviour with Disqus please? So that it never says ‘0 comments’, and rather ‘Leave a comment’ when there are no comments?

Hi @TipMaster,

Thanks for reaching out.

Regretfully, enhancing or creating custom code is outside the scope of our theme support. You may seek help for a 3rd party developer or you can avail One to help you with your concerns.

Hope that helps and thank you for understanding.

Ah, okay. Given that X includes the handy Disqus plugin it is a little bit of a pity that it doesn’t go that extra step to automatically adjust the post meta too. The code at the link I posted is almost complete except for this one detail.
Good to know about One Support - I hadn’t heard of that, thanks. I might well subscribe if and when I get a money-generating website off the ground.

Hey @TipMaster,

Some of the old code in the thread might be able to help. For example, the code given by @Paul.R can be useful if you are using the Integrity stack.

Hope this helps.

I saw that post, but it states that the code posted by @Paul.R doesn’t work. I just tried it (with adjustment for Renew) and, indeed, it doesn’t work — it adds icons and replaces ‘Leave a comment’ with ‘Make a comment’, but it doesn’t track and display Disqus comments, only WordPress comments.

The working code at the end of that post is the same code as at the link I posted — so, it doesn’t help any further unfortunately. It works to count the Disqus comments, but I just can’t see how to keep the ‘Leave a Comment’ text in preference to ‘0 Comments’ text.

Hi @TipMaster,

I am not sure about this case, but I see that there is a JavaScript error on the browser console when I visited the single post page where the Disqus is integrated.

That is an error happening on the embed.js file of the Disqus framework. Can you please let us confirm that you are using our extension for the Disqus comments? If not please try to use the plugin by going to Pro > Validate and scroll to find the plugin.
And if you are using our extension, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Admin URL
– WordPress Admin username / password

To create a secure note, click the key icon underneath any of your posts.

Thanks

@tristup Thanks for taking a deeper look.

Yes, I am using the Disqus plugin that is included with X.

I guess you saw that error somewhere on the site I posted in that other support thread. That’s not where I was testing this code for Diqus comments.

However, now that you mention it, I can see that Disqus isn’t loading on that site at all anymore… so it would be nice to fix that error of course!

Also, I didn’t think I had the Disqus comment link code on that site — but it looks like I do, somewhere! Confused.

I’ll post details for login to a staging copy of that site shortly.

Hey @TipMaster,

Thanks for providing the credentials. I see that you’re using an old version of the Disqus plugin. Please ensure that everything is up to date according to our version compatibility list at https://theme.co/docs/version-compatibility. Please follow the best practices when updating your theme and plugins. See https://theme.co/docs/how-to-update for more details. You can get back to us if the issue persists.

Regarding the Disqus feature that you want, I’ll post it in our tracker as a feature request. We cannot continue providing suggestions as that would be veering into custom development which is outside the scope of our product support.

Thank you for understanding.

@christian

I’m confused about the Disqus plugin updates. Although to date I haven’t used this site much, I’ve kept it up to date when I’ve seen that there are new versions of the theme or plugins.

I’ve seen no notice to indicate that this plugin is out of date and should be updated. There doesn’t seem to be any link I can click to update automatically, and no indication of any package I can download to update manually. I can’t see an answer to this at the links you posted either — only information to update the entire theme, which I’ve kept up to date anyway. So, I’m unsure what the procedure should be here — I’m aware of the best practices for backup and so on, but how should I actually do the update?

Should I just uninstall from Plugins and then install from the X menu (like I did originally after I installed X years ago)?


I understand that you must draw a line somewhere with support. But this does feel like a feature that should be in the product, so a feature request seems like a good idea — thanks for adding it.

In the meantime, you might consider updating that other thread — it has almost all of the code that we need, it is only missing the ability to keep ‘Leave a comment’ instead of ‘0 comments’. Just a thought — I understand that these things can stir up more questions that eat into your support time and might not be worth it if you don’t have lots of other people asking the same thing.

Hey @TipMaster,

Yes, just uninstall the old plugins and install them again from X > Validation.


Regarding the feature you need, I’ve already submitted it as a feature request. Please stay tuned for updates. For now, please take the sample code provided in the old thread to a developer so that he can enhance it further.

Thank you for understanding.

Great, thanks @christian - I’ll do that tomorrow.

Hi @TipMaster,

You’re welcome and let us know how it goes.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.