WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding Comments to Pages (28 posts)

  1. RJ3Labs
    Member
    Posted 7 years ago #

    This is my website in progress: http://www.rj3labs.com

    Right now, I'm having a hard time getting comments to work on the static wordpress pages (Write --> Write Page)

    The "Allow Comments" button IS checked under discussion.

    Look at the "Test" page for an example of what I'm talking about. It's not a theme thing either, because I can switch to default and it still doesn't work.

    Thanks for your help.

    Russ

  2. Doodlebee
    Member
    Posted 7 years ago #

    Static Pages are static. Comments are for posts. I may be wrong, but I don't believe you can add comments to static pages (and that's by default). There might be a plugin or something - but i don't think so.

    You could swap out the Pages and turn them into specific post categories - then you can have the comments function active. That's an option for you.

  3. moshu
    Member
    Posted 7 years ago #

    Actually, you can.
    You just need a page template that calls for the comment template as your single.php and/or index.php does.

  4. pramodd
    Member
    Posted 7 years ago #

    Locate following code in page.php [template file]

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php endwhile; endif; ?>

    In between these lines add following:

    <?php comments_template(); ?>

  5. RJ3Labs
    Member
    Posted 7 years ago #

    pramodd, thank you very much! I'll make this a post on my site so others can know.

    Russ
    http://www.rj3labs.com

  6. deZigner
    Member
    Posted 6 years ago #

    but what about if we only want it on one page?

  7. Chris_K
    Member
    Posted 6 years ago #

    Make two Page templates, one with comments and one without. Read more about Page templates at Pages in the codex.

  8. dfradin
    Member
    Posted 6 years ago #

    I did as described above with the default template page.php.

    Comments field and side bar show fine. BUT after the first comment is left, the side bar disappears and no comments show, just the notice that there is one response.

  9. eLeKaeMe
    Member
    Posted 6 years ago #

    I tried this and worked:

    <?php if (('open' == $post-> comment_status)) { comments_template(); } ?>

  10. rslifka
    Member
    Posted 6 years ago #

    Just to throw my hat in here, this works great for me. Thanks everyone!

  11. godofcomics
    Member
    Posted 6 years ago #

    works here too, awesome.

  12. phoenixstu
    Member
    Posted 6 years ago #

    @eLeKaeMe

    Thank you. That woks wonderfully. :)

  13. muymalestado
    Member
    Posted 6 years ago #

    Thank you for being clear for us numpties!

  14. liam27
    Member
    Posted 6 years ago #

    @eLeKaeMe

    Thank you, this seems to have worked for me as well.

    Also, if you want comments on one Page only, then simply uncheck the Allow comments option when in the Manage Page screen.

  15. viceer
    Member
    Posted 6 years ago #

    Thanks... exactly what i've been looking for.

  16. devang-gandhi
    Member
    Posted 6 years ago #

    Thanks... I had been trying to fix this for a while until I found this thread. It works.

  17. Frostfox
    Member
    Posted 6 years ago #

    Do you need to edit the theme page.php files or another. I can't seem to get it to work with the Mandigo theme. Please help me figure this out.

  18. allotts
    Member
    Posted 6 years ago #

    Worked for me in WP 2.3.3 That is, eLeKaeMe's line of code just before:

    <?php comments_template(); ?>

  19. seomartin
    Member
    Posted 6 years ago #

    This is a bump - as I just googled how to do this, came up with this topic here - and it works beautifully!

    Thanks all!

    Martin

  20. Elizacoach
    Member
    Posted 6 years ago #

    The eLeKaeMe solution worked so easily... no stress!

    Thank you

  21. willthom
    Member
    Posted 6 years ago #

    First post -

    Thanks a million for this.

  22. llamaman
    Member
    Posted 6 years ago #

    I tried all the things listed above, but I am having issues displaying comments on my category pages (http://www.teamupmn.org/category/culture/). I am getting text that reads "Comments Off".

    My current comment code reads:

    <?php if (('open' == $post-> comment_status)) { comments_template(); } ?>
    <?php comments_popup_link('Leave your opinion of this article. »', '1 Opinion »', '% Opinions »'); ?>

    I am using WordPress 2.5, don't have any plugins installed that would mess with comments, and have checked the "Allow people to post comments on the article" box in the admin menu.

    Any ideas on what might be causing this??

    Thanks!!

  23. justjohnna
    Member
    Posted 6 years ago #

    I have comments on one page (Feedback), but I can't get comments to show up on any others, even when I switch back to default Kubrick theme.

    In the default theme, there is no feedback template, so then I get no comments.

    I have comments turned on in admin settings.
    I have comments turned on in individual pages.
    I have a <?php comments_template(); ?> tag between
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    and
    <?php endwhile; endif; ?>

    Page with comments:
    http://giftsds.segullah.org/feedback/

    Page that should be set up for comments, but there are none:
    http://giftsds.segullah.org/gifts-outreach-program/
    http://giftsds.segullah.org/submit-a-blog-to-our-listing/

    I'm running WordPress 2.5.1
    I'm bewildered. What am I missing?

  24. justjohnna
    Member
    Posted 6 years ago #

    Also, I tried putting other pages on the feedback template, but still the Feedback page is the only one with comments.

    Very bewildering.

  25. justjohnna
    Member
    Posted 6 years ago #

    I re-loaded a fresh comments.php and comments show up where asked for.

    I'm not sure how I corrupted my comments.php file.

  26. Ron Fredericks
    Member
    Posted 6 years ago #

    The comments above worked for me too. I am using wp v: 2.5.1 and the default theme: The default WordPress theme based on the famous Kubrick.

    In the theme's pages.php I added one line just before <?php endwhile; endif; ?> as shown here:

    <?php if (('open' == $post-> comment_status)) { comments_template(); } // add this for comments on static pages RDF 5/14/08?>

    <?php endwhile; endif; ?>

    Thanks again:

    Ron Fredericks

  27. purealtar
    Member
    Posted 6 years ago #

    i need to have different comment.php templates...

    for example the comments.php says "leave a reply" or something like that...

    for posts that is fine, bu i have testimonials page that needs to say...

    "give your Testimonial" or something like that>..

    i tried to create a second version of the comments.php, calling it comments-testimonials.php and including it in the testimonials page... but no comments show?

    any ideas?

    thanks

  28. purealtar
    Member
    Posted 6 years ago #

    i ended up finding the wp-includes/comment-template.php and
    duplicating the comment_template function calling it comment_template2 and pointing it to mey new comment template comment-testimonials.php and that worked

Topic Closed

This topic has been closed to new replies.

About this Topic