WordPress.org

Support

Support » Themes and Templates » [Resolved] Comments not working in custom theme

[Resolved] Comments not working in custom theme

  • Hi Guys,

    I have a custom theme that i have written but for some reason when i add the

    <?php comments_template(); ?>

    tag to my theme, it just displays “comments closed” on the page im trying to use it on.

    When i switch back to a default theme it seems to work fine (the comments box shows up etc).

    Is there anything obvious that i may have missed that is forcing comments to be closed?

    Any feedback gratefully received!

    Rob

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    Is there a template file called comments.php in your custom theme directory? If so, could you post the content of this file here?

    Cheers

    Thanks for getting back to me… yes there is…
    here is the pastebin link…

    http://pastebin.com/hAmk7qXA

    No problem :-). The theme file itself is absolutely fine. Well in that case, I don’t really understand, why the site comments would behave differently with default theme. Just to double check, if you go to edit post/page you want the comment form and comments to appear at, can you make sure to comments are allowed for that post/page?

    Thanks

    Yeh it’s baffling me too…

    I’ve enabled the comments on the ‘discussion’ panel of the edit post/pages bit in wp-admin but nothing… just ‘comments are closed’.

    Is there another setting somewhere (functions.php maybe?) that dictates whether or not comments are allowed?

    This is a bit of a nightmare!

    Thanks again for your help tho!

    Well, there really isn’t any other settings. The only other general settings is located at Settings -> Discussion but guess it’s enabled there. If it’s not too much trouble for you, could you let me have the theme you are developing? [mod: don’t solicitate ont-to-one support; please keep the support in the forum] I would take a quick look.

    Cheers

    sure no problem… have u got an email address? I dont really want to publish the site on a public forum 🙂

    Mine is [email moderated – this forum does not provide support via email] if you want to send me it there.

    Thanks again

    Just sent you an email.

    Thanks

    Rob,

    I think I got it working. You are using lot of custom queries. Haven’t investigated it into detail, where the problem is, but using wp_reset_query() before loading the comments did the trick.

    Cheers

    That’s excellent Petr, thanks very much!

    My PHP ‘skills’ aren’t the best and this has proved really helpful!

    Cheers

    Oh yeh… resolved!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Comments not working in custom theme’ is closed to new replies.