Comment anchor disqus

Posted in: Newspaper
Post count: 159

A hint and a wish for the next update if someone is using the disqus comment system:

In \themes\Newspaper\includes\wp_booster\td_module.php at line 141 you have to channge
this

//$buffy .= '<a href="' . get_comments_link($this->post->ID) . '">';
$buffy .= '<span class="td-sp td-sp-ico-comments td-fake-click" data-fake-click="' . get_comments_link($this->post->ID) . '"></span>';
$buffy .= get_comments_number($this->post->ID);
//$buffy .= '</a>';

to this

$buffy .= '<a href="#disqus_thread">';
$buffy .= '<span class="td-sp td-sp-ico-comments td-fake-click" data-fake-click="' . get_comments_link($this->post->ID) . '"></span>';
$buffy .= get_comments_number($this->post->ID);
$buffy .= '</a>';

Now the comment anchor goes right to the disqus comment form.

P.S. Unfortunely the file “td_module.php” can’t modified for a child theme (why not?), so if the theme is updated, you have to check if corresponding file was changed…

Post count: 6600

Hi,

Unfortunately not all theme components can be modified via child theme because they are part of the theme core.

Thanks for understanding

Post count: 9544

+1 on adding a switch for this, as we’ve also standardized on Disqus.

Post count: 780

I’ve added this to my todo list. We’re working on V4 🙂

Post count: 159

Did I say that you’re doing an awesome job?! 🙂

Post count: 9544

double awesome 🙂

Post count: 8

Hi, has this been updated or been moved around in the theme? I’ve changed my code as below by commenting out the original a href line and adding my own, but it hasn’t worked.., the link is still pointing to #comments

From line 178 in td-module.php

code

  • This reply was modified 10 years by panorev.
  • This reply was modified 10 years by panorev.
  • This reply was modified 10 years by panorev.
  • This reply was modified 10 years by panorev. Reason: sorry for multiple edits, pasting the code messed up the post so I screenshot the code
Post count: 7909

Hi,

Please check the plugin documentation how to implement this – https://help.disqus.com/customer/portal/articles/565624-adding-comment-count-links-to-your-home-page
Or if you want to add this directly in the code, try like this – http://screencast.com/t/CSUU8JtZhttp://screencast.com/t/mrSvSOR7l

$buffy .= '<a href="' . $this->href . '#disqus_thread' . '">';

Thanks!

Post count: 8

Thanks this is great. I realise why it didn’t appear to work, it was a module comment link rather than a page comment link. Where can I make this same change for the comment icon at top of a page/post like here:

Is there anywhere else you know I would need to make this change?

Thanks!

Post count: 7909

Hi,

For post page link please check this file – http://screencast.com/t/9b5MOqVr

Thanks!

Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic.