I have designed this site to display comments only on blog posts. In Wordpress, the pages that show blog posts are considered “post pages” and are not actually “page” pages. A page in Wordpress is a static article or content that is permanent and does not follow an article timeline. Pages do not show up in your post section. They’re great for “About Me,” “Testimonials,” etc.
In Wordpress, when you create a page, you typically clean it up by removing the ability for users to comment on the static information and limit them only to commenting on the blog posts. To do this, simply uncheck the comments check-box in the Quick Edit section when you view your list of Pages (Assumes Wordpress version 2.7.)
When you install a plugin like IntenseDebate, it takes over the commenting feature and renders that checkbox useless (currently so, but I suppose plans are in the making to change this.)
I had a particular problem with my site. I needed to remove the commenting feature from the pages, except for one. I wanted people to be able to comment on my Testimonials page only. As soon as I installed IntenseDebate, I was basically forced to show a commenting interface on every page. So, I had to come up with a quick edit to my Wordpress theme to accomodate this.
In a normal Wordpress theme that has not be creatively crafted by it’s author, there is usually a “page.php” file in the root of the site. In this file is a section that calls a comment function called “comments_template().” Since my particular theme has re-arranged where this function is called, I had to do a bit of hunting, but once I found the code (it was buried in what’s called an include folder) I was able to modify it.
IntenseDebate let me know that as long as I could control the comments_template() function call in any of my files that I could essentially turn on or turn off the IntenseDebate plugin based on whatever page it was on.
The following is the code that was in the comments.php file that I located before I made the edit:
<?php
if (function_exists(’wp_list_comments’)) {
comments_template(”, true);
} else {
comments_template();
}
?>
Reading this in plain english one would read: If comments are enabled on the blog, and the post or page is set to allow comments, then display the comment form for users, otherwise don’t. We’ll call this the Comment Test.
The following is what I changed it to:
<?php if(is_page(’Testimonials’)) : ?><?php
if (function_exists(’wp_list_comments’)) {
comments_template(”, true);
} else {
comments_template();
}
?><?php elseif(is_page()) : ?><? else : ?>
<?php
if (function_exists(’wp_list_comments’)) {
comments_template(”, true);
} else {
comments_template();
}
?><? endif; ?>
Reading this in plain english it reads: If the page being viewed has a title of “Testimonials,” then run the Comment Test to see if IntenseDebate should be displayed, otherwise if it’s just a regular page, don’t display any comments, but if it isn’t a regular page, go ahead and display the IntenseDebate comments.
I know, if you’re not a programmer (which strangely enough I thought I would never be and still don’t think I am) then you’ll be completely confused by this “if then else” language. Programmers have to think in terms of every step possible, from “I just thought about picking up my coffee” to “if I have a pencil in my hand, put the pencil down, then reach for the coffee. If my fingers are clenched, open then, reach through coffee mug handle, but if handle is turned away from me, turn the coffee cup first, then while the coffee cup is turning around, do this or that.”
Really quite tedious…but it got the job done. I love my coffee!