WordPress.org

Ready to get started?Download WordPress

Forums

How to Add Comments link to Pages? (11 posts)

  1. misty9
    Member
    Posted 6 years ago #

    There are Comments links in all the Posts(click on Uncategorized (3) under Categories in the following testing page at http://stocktrends.skybluedot.com/wdp4_stocktrends/)

    How do I tweak the code so that the Comments links are automatically added on to Pages such as About and MyPortF?

    Thanks.

  2. misty9
    Member
    Posted 6 years ago #

    Anybody there? Thx.

  3. manojit
    Member
    Posted 6 years ago #

    Compare files page.php and single.php (in your theme folder), and see what is missing in page.php; for example, <?php comments_template(); ?>

  4. misty9
    Member
    Posted 6 years ago #

    The Green Bug theme doesn't seem to have a file named by Page.php. Here are all the default files:

    comments.php
    footer.php
    functions.php
    header.php
    index.html
    index.php
    sidebar.php
    single.php
    style.css

    Perhaps, I should find a Page.php from other theme and tweak it to fit the Green Bug theme. Any suggestions?

    Thanks.

  5. manojit
    Member
    Posted 6 years ago #

    Hmm, interesting. I ran out of steam here. Gurus?

  6. misty9
    Member
    Posted 6 years ago #

    I guess that not all theme designers follow the standards. Green Bug theme is just one of those examples. Given that his Page content shows up in the theme withOUT the Page.php, I suppose there might be a way to tweak the code to have the Comments link for all Pages instead of Posts.

    Green Bug theme can be download from the following location:
    http://themes.wordpress.net/columns/2-columns/3574/green-bug-10/

    Now, can you gurus help me with the following:

    1. What is the general program calling sequence for the 9 files from my last post? Probably starting from index.php?

    2. Can you give me some code example in how Page.php is called if it exists?

    Thanks.

  7. moshu
    Member
    Posted 6 years ago #

  8. misty9
    Member
    Posted 6 years ago #

    Yes. Thanks for the very helpful page. I will study that page and work on creating a simple page.php with <?php comments_template(); ?> in it.

  9. misty9
    Member
    Posted 6 years ago #

    Okay, my simple page.php with <?php comments_template(); ?> adds the Comment form to ALL Pages.

    Now, there are certain pages that I do not wish to have the Comment form, how can I achieve that? Thanks.

    Oh, I get it. Deselect the "allow comments" from WordPress web interface.

    Let me test everything before I update this post. Thanks so much everyone.

  10. moshu
    Member
    Posted 6 years ago #

    Make another Page template (see the Templates section: Pages).
    When you have the default (page.php) AND another one, then you have the option to select which template to use when Writing.

  11. misty9
    Member
    Posted 6 years ago #

    Oh, I get it. Deselect the "Allow Comments" from WordPress web interface for the pages that you don't want Comments forms.

    Let me test everything before I update this post. Thanks so much everyone.

Topic Closed

This topic has been closed to new replies.

About this Topic