WordPress.org

Ready to get started?Download WordPress

Forums

Enable/Disable Comments for Pages (11 posts)

  1. hiiers
    Member
    Posted 8 years ago #

    I had two goals.

    1. To enable Comments for Pages
    2. Disable comments for certain Pages

    I've got the first goal done adding <?php comments_template(); ?> to the page file or using this hack http://www.keyvan.net/code/paged-comments/

    Is there some way to enable page comments for certain pages? Such as 5 pages out of a group of 8 pages.

    I simple yes/no answer in if this is possible would be great!

    Thanks!

  2. skulled
    Member
    Posted 8 years ago #

    When you are creating the page, you have a lot of options on the side of the editor.

    Just un-check the option where it says "Allow Comments"

    That should disable comments for that particular page. :)

  3. hiiers
    Member
    Posted 8 years ago #

    I can see what you mean but there is no option for that in my 'Write Page'.

    [ http://img505.imageshack.us/img505/1535/looj9vl.png ]

  4. moshu
    Member
    Posted 8 years ago #

    Left top corner - under Discussion :) you have it.
    Unchecked it will still display the "comments off" msg.

    If you want to eliminate totally on certain Pages - you should create a second Page template which doesn't have the call for comments, and when writing Pages you can choose which template you want to use.

  5. vicar
    Member
    Posted 8 years ago #

    I found that "comments" option but it doesn't work. It is checked "on" for all of my static pages and None of them have the "Comments" option on them. Any ideas? I am using the default template for version 2.02.

    Thanks!

    P.S. does it work to add onto an old thread?

  6. rablake
    Member
    Posted 7 years ago #

    I'm running into this problem too, using the default template also. Checkbox for comments checked, but no apparent way to make any.

  7. dsamuel
    Member
    Posted 7 years ago #

    I have comments_template() working correctly, and I can enable/disable comments.

    What I want to do is not display anything when posts are disabled. Right now when I disable comments_template(), there is a message below the post saying that comments are closed. I don't want this. I want either nothing, or the ability to post.

    Is there a way of doing this? I particularly want to use it for my http://www.dougs-travels.com site, and probably others that are in the works as well.

    Thanks!

  8. Kafkaesqui

    Posted 7 years ago #

    "What I want to do is not display anything when posts are disabled."

    Replace your call to comments_template() with this:

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

  9. dsamuel
    Member
    Posted 7 years ago #

    Thanks! That helps with the problem, and helps me understand more about how WordPress works.

  10. dsamuel
    Member
    Posted 7 years ago #

    I spent some time learning more about this so I could get my posts to behave exactly the way I want them to. I want comments to appear on some pages, but if comments are disabled, I don't want anything about comments to appear.

    I wrote an article about it on my website http://www.discover-doug.com - if you need to learn more about this subject, I hope the article might help.

    –Doug

  11. dsamuel
    Member
    Posted 7 years ago #

    My apologies to those who have tried to find the article Customizing Comments in WordPress a Template, mentioned in the post above - it's there, but a direct link would be helpful to some! Here it is:

    http://discover-doug.com/2006/10/31/customizing-comments-in-wordpress-a-template/

Topic Closed

This topic has been closed to new replies.

About this Topic