I have already deactivated the ability to comment on every page but now it just says "0 comments" this is very annoying.


Try disabling the comments module, or set the comments to be hidden in the content type settings.


The problem you are having is caused by the code in the template.php file.

Change the line containing the following code:

if ($vars['page'] && isset($vars['content']['links']['comment'])) {

Replace it with the following code:

if ($vars['page'] && isset($vars['content']['links']['comment']) && $vars['comment_count'] > 0) {
  • Worked perfectly well with me, thank you very much! Please note the code above has a typing error at the end. The ` should be removed. Please change the line containing if ($vars['page'] && isset($vars['content']['links']['comment'])) {` to the following one: if ($vars['page'] && isset($vars['content']['links']['comment'])) { Please note the last character missing in the correct form of the code. The reason for this is that I use the search option (ctrl+f) and does not find unless the ` is removed. Many thanks Dimitri Raptis – user2930 Sep 12 '11 at 20:12
  • @Dimitri ` can be used to highlight inline code, by using them as quotes. Most likely that Kiam just missed one in the beginning to make the formatting actually work. Keep that in mind and good find. Also you can make edits on posts instead of commenting (which will have to be approved when you have less than 2000 rep) – googletorp Sep 13 '11 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.