Remove Comments Closed Text

June 25, 2009 · 15 comments

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.

Disable Comments On Page

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:

Thesis Comments Options

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 }

1 Joe July 6, 2009 at 5:07 am

Both your solutions don’t work at all.

2 Chaz July 6, 2009 at 3:46 pm

@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.

3 Ann September 11, 2009 at 10:55 pm

Where would you add this bit of code to Thesis Open Hook? Sorry, I’m new at this. 🙂

4 Chaz September 12, 2009 at 2:13 pm

@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.

5 kc October 13, 2009 at 11:25 am

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!

6 Paul November 29, 2009 at 5:31 pm

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.

7 Chaz November 30, 2009 at 12:27 am

@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.

8 Ian Paul Marshall January 30, 2010 at 9:06 pm

Thanks so much! Worked like a charm.

9 Kam March 9, 2010 at 9:17 pm

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?

10 Greg Lam March 11, 2010 at 11:10 pm

Worked. So simple, can’t believe I didn’t see it!

11 David Merrick June 15, 2010 at 10:33 pm

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!

12 Rick June 28, 2010 at 6:23 pm

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.


13 DWcourse November 2, 2010 at 6:03 pm

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.

14 Paul Bennett December 21, 2010 at 4:04 pm

For Thesis 1.5:

.custom .format_text .to_comments {display: none ;}
.custom .teaser .edit_post {display: none ;}
.custom .teaser .teaser_date {display: none ;}

15 Brandy Miranda December 23, 2010 at 7:14 pm

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.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Previous post:

Next post: