Please add Disqus support (code example inside)

Posted in: Newspaper
Post count: 7

The Newspaper theme is one of the most popular WordPress themes and Disqus is one of the most popular WordPress commenting plugins, but the two don’t work together. Please add an option to use Disqus instead of the built-in WordPress comments.

I’ve edited td_module.php and td_module_single_base.php to add Disqus support, but my changes will be overwritten with the next theme update. Please add native support for Disqus to the Newspaper theme. Here is a code example that is working for me and can be used to help you get started:

includes/wp_booster/td_module.php

https://gist.github.com/ChrisBegley/a87c775e19903944b4f9c7d06efdfcf1


function get_comments() {
        $buffy = '';
        if (td_util::get_option('tds_m_show_comments') != 'hide') {
            $buffy .= '<div class="td-module-comments">';
            $buffy .= '<a href="' . $this->href . '#disqus_thread">';
            $buffy .= get_comments_number($this->post->ID);
            $buffy .= '</a>';
            $buffy .= '</div>';
        }

        return $buffy;
    }

includes/wp_booster/td_module_single_base.php

https://gist.github.com/ChrisBegley/7bfc66d9b3c84849936f3a65bd3e1c4c


function get_comments() {
        $buffy = '';
        if (td_util::get_option('tds_p_show_comments') != 'hide') {
            $buffy .= '<div class="td-post-comments">';
			$buffy .= '<i class="td-icon-comments"></i>';
            $buffy .= '<a href="' . $this->href . '#disqus_thread">';
            $buffy .= get_comments_number($this->post->ID);
            $buffy .= '</a>';
            $buffy .= '</div>';
        }

        return $buffy;
    }
  • This topic was modified 8 years by ChrisB.
Post count: 20688

Hi,

Indeed, the theme works with and displays at the moment only the default WordPress comments. Thank you for taking the time and posting this solution, it may be helpful for other users.
This will be considered by our team and at some point be available in the theme as an alternative.

Thanks

Post count: 26

i may have to try using your code, so thanks Chris! Still having luck with it?

Post count: 7

Yes, it’s still working. I hope it gets added to the theme by default soon.

Post count: 26

Would you mind sharing instructions on how to implement it? I found the php files, added the code to the end of each of them, and then overwrote the versions on the server, but then my WordPress would no longer load. It was back to normal when I undid my changes.

Do I need to do more than that?

thank you!

Post count: 26

(also did you upgrade to Newspaper 9 by any chance?)

Post count: 23

Hey daveml75, did you get this to work?

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.