Is there a way to add comments/comment form to a custom template file without having to install the Panels module? I had initially thought I could do it through a php script on the page, but have yet to find an answer.

I'm stuck, but all I need is for it to be at the bottom of my custom template file, which is for a custom content type. Thanks!

1 Answer 1


You may want to take the sample node template file and update as per your requirement. Here is the code which renders the comments section of the node template file.

<?php print render($content['comments']); ?>
  • That seems to work, however I'm stuck on one issue. Do you know where to delete the original "content" section. I have rendered out individual fields to work on, and so now two copies show up. One is how it would look if done completely in drupal and the other is my custom formatting. Do you know what code I must delete?
    – Matthew
    Mar 16, 2016 at 4:53
  • Never mind! Got it. Thank you again so much, I found the code I was looking for.
    – Matthew
    Mar 16, 2016 at 4:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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