Support » Your WordPress » Not displaying Comments

  • Hey. I’m sorry if this has been answered before, but I couldn’t find it anywhere.

    Basically, if you look here for example, you will see it advertises there are 2 comments on the post, which there are, as I have moderated them. However, just below that, it says there aren’t any. I haven’t touched the code that displays the comments, however, when I upload the original theme (I have modified mine, as you can no doubt see), it seems to work fine.

    Any thoughts?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Peter Westwood


    WordPress Lead Developer

    Can you upload you theme’s php files somewhere to look at – it looks like something wonky in your theme if they work with the default theme. <- The comments file <- The main page

    These are the only files I’ve played with, bar the Header and Footers which contain no (or at least nothing important) PHP code. I’ve looked through these pages, but I couldn’t spot anything, hopefully you guys can 🙂

    Moderator Peter Westwood


    WordPress Lead Developer


    This looks fairly easy to solve I think.

    Change line 11 of comments.php from:
    <?php if ( !$comments ) : ?>
    <?php if ( $comments ) : ?>

    You have inadvertently negated the logic of the If check so that if there are no comments it will try and display them and if there are comments it will display the no comments message!

    hope this helps

    Yeah, I was trying something, then forgot to upload the edited file. lol

    That’s been ammended, but the problem persists. Any other thoughts?

    Okay, just throwing this out there. Try this:

    1. Save a copy of your comments.php to your hard drive.
    2. Replace this
    ‘< p > <?php _e(‘No comments yet.’); ?> < / p>

    With this
    <?php if (‘open’ == $post-> comment_status) : ?> `

    If it doesn’t work just upload the php file you saved to your hd and I’ll start over. Oh yeah, remove the

    Nevermind that last part, the forum formatted my post funny.

    No luck I’m afraid.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not displaying Comments’ is closed to new replies.