WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comments not working in custom theme (11 posts)

  1. robsarna
    Member
    Posted 1 year ago #

    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

  2. BoUk
    Member
    Posted 1 year ago #

    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

  3. robsarna
    Member
    Posted 1 year ago #

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

    http://pastebin.com/hAmk7qXA

  4. BoUk
    Member
    Posted 1 year ago #

    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

  5. robsarna
    Member
    Posted 1 year ago #

    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!

  6. BoUk
    Member
    Posted 1 year ago #

    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

  7. robsarna
    Member
    Posted 1 year ago #

    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

  8. BoUk
    Member
    Posted 1 year ago #

    Just sent you an email.

    Thanks

  9. BoUk
    Member
    Posted 1 year ago #

    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

  10. robsarna
    Member
    Posted 1 year ago #

    That's excellent Petr, thanks very much!

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

    Cheers

  11. robsarna
    Member
    Posted 1 year ago #

    Oh yeh... resolved!

Topic Closed

This topic has been closed to new replies.

About this Topic