makewhatis

Random Linux Garble.

Removing Thematic Comments From Single Post

I was putting together a child theme for a client today, and they required that their posts exist without the ability to add comments. This is a very trimmed down template, only used for posting news. After hunting around a bit I finally found the exact action hook to remove in order to achieve this. Add this into your functions.php file inside your child theme:

This will completely remove the comments box from the post.

This isn’t it though, I also had to remove the option to see comments in the loop, archive list, etc. So keep that in mind if you are removing comments from the theme altogether. I used filters for all the other places that I removed comment related code, so I won’t go into that here.