WordPress.org

Ready to get started?Download WordPress

Forums

Trouble with comments_template() on single (5 posts)

  1. Matt
    Member
    Posted 2 years ago #

    comments_template( '', true ) does show comments, including "Leave a Reply". But only if the post already has 1+ comments.

    If it has 0 comments, nothing... the comments div does not appear. "Leave a Reply" does not appear. So there is no way to leave a comment on posts that have no comments. There is no conditional around the comments_template() tag.

    The theme is Twenty Ten that I've been heavily modifying.

  2. Marventus
    Member
    Posted 2 years ago #

    Hi there,

    The comments_template function should be displaying the comment form even when there are no comments for a post.
    The most likely reason for your problem is that you must have broken something while editing the theme.
    To confirm this, rename your modified version of Twenty Ten (both the theme folder inside your "[wp-root]/wp-content/themes" directory and the theme info that WP reads from the theme's style.css file - at the top) , re-upload the original Twenty Ten theme, activate it, and test the comment section again.
    If it works fine, it means something broke in your modified version. If that is the case, you can compare both theme's single.php files one next to each other to spot the problem.

    Good luck!

  3. Marventus
    Member
    Posted 2 years ago #

    Hi,

    Where you able to figure this out? If so, could you please mark your topic as resolved?

    Thanks!

  4. Matt
    Member
    Posted 2 years ago #

    First, thanks for your response, Marventus, it makes complete sense. Second, sorry for not getting back to you or back to this topic to thank you... I haven't tried the solution yet. Busy busy. I'll get to it tonight and mark this topic one way or another.

  5. Marventus
    Member
    Posted 2 years ago #

    Don't worry about it: no rush. I was doing a routine check on all the topics I have contributed to recently.

Topic Closed

This topic has been closed to new replies.

About this Topic