So I recently acquired the excellent Thesis theme for WordPress. What separates Thesis from so many other themes out there is its addition of custom hooks and filters for styling. Despite all the things this makes extremely easy, there are a few things that are made needlessly difficult. For example, completely removing comments from pages that use the Thesis Custom Template. While you can turn the comments off in the page settings as shown below, there isn’t a simple hook you can call to completely prevent the comment loop from executing.
As a result, each of your custom pages have the annoying little blurb at the bottom saying, “Comments are closed on this entry.” A quick Google search will turn up a number of sites that give you instructions on how to hide the comment with CSS using the custom.css file.
.custom .comments_closed p {display: none ;}
While effective, why does this text have to be output at all? There should be a simple way to completely eliminate the comment loop execution. After digging through the Thesis code for a bit, I discovered that there is a way to do this that doesn’t require modifying any of the Thesis core files while still allowing you to use the Thesis Custom Template. The fix simply requires you to add the following lines to your custom_functions.php file.
global $thesis; $thesis[‘display’][‘comments’][‘disable_pages’] = true;
Voila! Those pesky closed comments statements are completely gone! No need for CSS, no need to create completely new page template, and no need to modify any Thesis core files!
UPDATE (07/06/09):
After playing with Thesis 1.5 a little more, I realized that you can accomplish the same behavior mentioned above through a simple checkbox in the Thesis Options menu. Under the Comments section, you’ll find the following:
Make sure the “Disable Comments on all pages” option is checked, and you’re all set. So if the code above scared you off, don’t worry. There’s now a solution for you!
{ 15 comments… read them below or add one }
Both your solutions don’t work at all.
@joe: I’ve tested both solutions with the most current version of Thesis (1.5.1) and both work. As mentioned in the update, the PHP solution is unnecessary as there is a GUI option that will completely disable comments for all pages. If you’re having trouble, I may be able to assist you if given more information.
Where would you add this bit of code to Thesis Open Hook? Sorry, I’m new at this. 🙂
@Ann: You actually do not need to add the PHP bit of code to the Thesis open hook at all. As noted in the update above, you can get the same functionality by clicking the “Disable comments on all pages” option under the Thesis Options menu in your WordPress administration panel. If you want to use the CSS to hide the comments, you would need to add the CSS code listed above to the custom.css file under the Thesis custom directory. If you need more help with this, I’d be happy to try and assist you via e-mail. Just let me know.
I checked “disable comments on all pages” along with a couple other edits in Thesis Options, Hit my Big A– save button, refreshed, and the {Comments on this entry are closed} is still there!
The disable comments on all pages button does disable comments. But it doesn’t get rid of the message “Comments are closed on this entry”. I thought that’s what this article was about.
@paul: I’m running Thesis 1.5+ (as mentioned above) and the “disable comments on all pages” button both disables page comments and removes the “Comments are closed on this entry” text on every page. This has been tested and is, in fact, how it’s done on this site.
Thanks so much! Worked like a charm.
I couldn’t get the code to work on Thesis 1.6
Also the disable comments on all pages does not remove the “Comments are closed on this entry” text in Thesis 1.6
Any ideas?
Worked. So simple, can’t believe I didn’t see it!
I’m using Thesis 1.7 and the CSS worked, but the addition to my custom_functions.php didn’t. I’m not interested in removing comments on all pages–I just want to get rid of the “Comments on this entry are closed” text. It seems to me that you could accomplish this with custom hooks, but for now the CSS trick works. Thanks!
Thanks but while this fix may work on earlier versions this doesn’t work on v1.6 OR the new v1.7.
Can’t understand why he insists on making it difficult to get rid of it, tho.
Rick
In Thesis 1.8 you have the option (in the same location) to uncheck the box for If comments are closed dispaly a message. This allows you to still use comments on selected pages but gets rid of the extra junk on pages with commenting disabled.
For Thesis 1.5:
.custom .format_text .to_comments {display: none ;}
.custom .teaser .edit_post {display: none ;}
.custom .teaser .teaser_date {display: none ;}
The disable comments on all pages button does disable comments. But it doesn’t get rid of the message “Comments are closed on this entry”. I thought that’s what this article was about.