Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display disqus on home page

I have a problem with disqus plugin on wordpress. How to display disqus on home page. so the single page is to be a home page, maybe like that. Any idea to solve it?

Thanks.

like image 999
Nizamil Putra Avatar asked Apr 09 '11 00:04

Nizamil Putra


People also ask

How do I embed Disqus?

Here's how it works: Grab the direct link to the comment. Visit https://embed.disqus.com/ and enter the link into the box. Copy the embed code into a blog post or website and publish.


1 Answers

I am also unable to get disqus to work on homepage. I can force the comments_template to appear by setting the following variable: $withcomments = 1;

which makes the comments.php template appear but the discus plugin only kicks in if its on other pages other than home page.

Its as if the plugin itself prevents it if is_home() rather than listening to wp $withcomments variable

UPDATE

Can be fixed with plugin hack to disqus.php:

In function dsq_comments_template change the conditional if(!(is_singular() && ( have_comments() || 'open' == $post->comment_status ))

In mycase where I wanted it to work on home and an aggregate page for a custom taxonomy 'issue' I did the following:

after global $comments; made a var for the more complex condition (it can go in the if instead)

$pass = (is_home() || is_taxonomy('issue')) || (is_singular() && ( have_comments() || 'open' == $post->comment_status ));

if(!$pass) { return }

... the rest of function ...

Be great if the developer made an option for this condition instead

like image 143
rgb Avatar answered Sep 18 '22 01:09

rgb