SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Photo Adventurer DebNCgal's Avatar
    Join Date
    Sep 2005
    Location
    Lewisvlle, NC (USA)
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Put Comments on a Static WordPress Page?

    I've got a popular article on a static page of my WordPress blog/website that I think would tend to draw comments from readers. I've looked for a plugin to accomplish this, but I've not found one.

    Is it possible to put comments on a static WordPress page? If so, could someone offer some input on how to accomplish that?

    Thanks!
    Deb
    Deb Phillips
    The Photo Gal

  2. #2
    SitePoint Addict
    Join Date
    Mar 2006
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only thing keeping you from allowing comments on a page is a theme that will allow it and making sure the comments are on in the edit screen for that page. If your theme has a single.php file that you think would look good for that page you can copy its contents, paste it into a new file and make it a "custom page template". Then select that template in the admin where you would edit that page.

    You can also create a file based on your current page.php (if one exists for your theme) and add the necessary template tags to display the comment form and comments.

    Custom Page Templates: http://codex.wordpress.org/Pages#Cre...Page_Templates

  3. #3
    Photo Adventurer DebNCgal's Avatar
    Join Date
    Sep 2005
    Location
    Lewisvlle, NC (USA)
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaronjj, I've not messed with creating templates before, but I think I'm getting what you're saying. My theme doesn't have a single.php file, but it does have a page.php file. I see by looking at the code in the page.php file that it produces the basic layout of a typical page.

    I also see some code in the index.php page that creates the comments section. That code is simply:

    Code:
    <h3>Comments</h3>
    <?php comments_template(); // Get wp-comments.php template ?>
    Is the above code generally what you're referring to for the tags needed to create the comments section on a new template page?

    Thanks a lot.

    Deb
    Deb Phillips
    The Photo Gal

  4. #4
    SitePoint Addict
    Join Date
    Mar 2006
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's it. I would caution you to make sure to backup your theme files before editting them. If you make a Custom Page Template like I suggested above then you will be able to select which pages you want to have comments on a little easier. If you just edit the page.php then comments will be available on all pages (not using a custom template) unless you disallow comments on the individual pages in the backend, in which case there is usually a message that says "comments are closed on this post".

  5. #5
    Photo Adventurer DebNCgal's Avatar
    Join Date
    Sep 2005
    Location
    Lewisvlle, NC (USA)
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I'm going to leave the page.php file alone but will create a template from it. Wow, suddenly this looks very simple!

    Thanks so much for your time and input, aaronjj. I *really* appreciate it.

    Deb
    Deb Phillips
    The Photo Gal


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •