Similar Posts
Visitors to this post also read
Categories
- Around The Web (76)
- Cinema/DVD/TV (21)
- Firefox/Thunderbird (27)
- Fun Stuff (44)
- Gaming Stuff (12)
- Miscellaneous Stuff (55)
- Music Stuff (33)
- News Stuff (12)
- Personal Stuff (55)
- WordPress Stuff (126)
Archives
- July 2010 (4)
- June 2010 (4)
- May 2010 (2)
- April 2010 (1)
- March 2010 (1)
- September 2009 (1)
- July 2009 (1)
- June 2009 (2)
- May 2009 (1)
- April 2009 (1)
- March 2009 (2)
- February 2009 (2)
- January 2009 (8)
- December 2008 (10)
- November 2008 (9)
- October 2008 (9)
Recent Comments (including Ping-/Trackbacks)
- Marco on How To Add Ping-/Trackbacks When Using Disqus
"Hey guys, it seems they have published a new version of the Disqus plugin which …" - James on How To Add Ping-/Trackbacks When Using Disqus
"Hi Marco - the post on fublo.net i…" - Marco on How To Add Ping-/Trackbacks When Using Disqus
"Thanks for the mentioning. I turned off trackbacks for Disqus now, also, but I t…" - James on How To Add Ping-/Trackbacks When Using Disqus
"Hi Marco, thanks for this code snip. I've extended some of the formatting us…" - Marco on How To Add Ping-/Trackbacks When Using Disqus
"Hi Chris,thanks for your feedback, I am glad the code works.I th…"
Disqus And Broken Anchors
July 10th, 2010 | View Comments
If you have the feeling that the anchors to the comments and to the comment form are broken since you installed the Disqus Comment System plugin for WordPress, you might want to read along… maybe you’d also be interested in other posts about Disqus.
When displaying how many comments a post has, WordPress determines the link to the comment section in two ways. If there is a comment, the anchor will be “#comments” (id=”comments”), if there are none, the anchor will be “#respond”, which leads directly to the comment form (“Leave A Reply”).
People who are interested in viewing the WordPress source code should look at the function comments_popup_link(), defined in wp-includes/comment-template.php on line 946ff (WordPress 3.0). The decision wether to use “#respond” or “#comments” is made on line 974ff.
In the WordPress template I use (cover-wp with some adjustments), the ID “comments” is used within the single.php or page.php and encloses the call of the comments.php. No problem here. Since that does not change and the single.php always exists, the anchor “#comments” should always remain existent.
The ID “respond” is being used in the comments.php… and there lies the problem with the Disqus integration: Disqus replaces the default comments.php with the one located at wp-content/plugins/disqus-comment-system/, and in that comments.php, there is neither a definition of an ID “comments” nor of an ID “respond”.
Therefore, the anchor “#comments” still worked on my site (as we now know, it is defined in single.php, not in comments.php). But since the Disqus comments.php was missing the “respond” ID, this anchor led to nowhere (every time a post had no comments).
The easy workaround is to add
to the top of the Disqus comments.php (plugin version 2.33.8752: line 8 after the remarks) – now, both anchors will be found wether Disqus is enabled or not.
With other templates that define both IDs within the comments.php, none of both anchors would work with Disqus at this time, since those IDs are not defined within the Disqus comments.php, yet.
Therefore, you could just try to add
to the top of the Disqus comments.php.
I have already notified the Disqus helpdesk (thanks, Ryan!).
Filed under: WordPress Stuff · Tags: comments, disqus, howto, plugin, troubleshooting, wordpress