• I need to have two different comment templates, one for posts and one for pages. I got it to work well by just renaming comments.php to comments2.php and changing the link in the posts page. However now comments don’t show up. Did I forget to do something else? Is it even possible to have different comments templates?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey Jessn,

    I believe you can – check this:

    http://wordpress.org/support/topic/164787?replies=3

    Thread Starter Jess

    (@jessn)

    Yep that’s exactly what I did, and no comments are showing up although they’re there.

    Thread Starter Jess

    (@jessn)

    Ah, got it. I needed it to be different widths because of the way the pages/posts are laid out, but I just wrapped the post comment form in a div with a specific width and that worked great. Thanks for your reply!

    No worries! 🙂 Glad you got it working.

    Hey Jessn or someone else that knows how.

    I have that exact problem, the comments does not show up.

    It says there are 2 comments but the comments are not visible, just the form to post another one.

    How do yo fixed it ? I cant find that post comment form you mentioned, can you be more precise in the fix please ?

    I am using WP 2.7 default theme.

    Also, is it needed to change the first line in the comments2.php file ?

    This>
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))

    need to have comments2.php ? or its ok as it is ?

    Thanks.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Stop bumping. Bumping is not allowed in these forums.

    Also, the correct way to call a different comments file (like comments2.php) is to do this in your page template:
    comments_template('comments2.php');

    Hi

    I really need some help with this: I have 2 comments templates. I have called my different comment file using the above method, from a page that I have set up for a specific category (category-62.php). The problem is, it seems to call up a default comment form (and not the different comment file – it is different to my comment file that I already have). I cannot change anything on it. Can anybody please tell me what could be the problem.

    I just had the same issue. I figured out after a bit of troubleshooting that when I changed the call to comments_template(‘comments2.php’); it didn’t really use the comments2.php file. Instead, it used the comments.php from the default template. So basically, my workaround was to just edit the comments.php file from the default template instead. Not the best workaround, but at least it works and i can have two separate comment files.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can I have two different comment.php templates?’ is closed to new replies.