WordPress.org

Forums

Comments on Pages (7 posts)

  1. Ajay
    Member
    Posted 10 years ago #

    I notice that my Pages can receive Pingbacks, so I assume that they can be commented on as well.

    How do I do this, so that the pages can be commented on just like posts?

  2. skippy
    Member
    Posted 10 years ago #

    If you have a seperate Page template (page.php), make sure that it includes wp-comments.php somewhere, in order to display the comment form.

  3. Ajay
    Member
    Posted 10 years ago #

    That worked, but I realize it comes on all my pages. Any way to do it only on certain pages?

  4. Lorelle
    Member
    Posted 10 years ago #

    In the Edit Page mode, in the same spot where it is on your Write Posts, next to the title, you can check or uncheck allow comments.

  5. Ajay
    Member
    Posted 10 years ago #

    Thanks Lorelle.

    I did more :)

    I created a template only for Pages on which I want comments and for these pages I choose this template.

  6. webdawg
    Member
    Posted 10 years ago #

    I am trying to create a Page-specific comments template. Meaning, I want the Main template to call on the default comments and the Page template to call on a custom comments template. For example:

    Main template: <?php comments_template(); ?>
    Page template: <?php include (TEMPLATEPATH . '/comments-for-pages.php'); ?>

    The "Leave a Comment" portion appears on the Page (from the custom comments template) but not the comments themselves. Even if I do a straight copy'n'paste from the default comment template to my custom comment template, this oddity occurs.

    Any ideas how I can get both the Leave a Comment box and the comments to appear together when calling upon a custom comments template?

  7. uriash
    Member
    Posted 9 years ago #

    Hi webdawg,
    maybe I can help you (although the last reply here is very old so maybe you've already found a solution)
    I made a custom template for a page with comments using this code:
    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h2>
    </div>
    <div id="contact">
    <?php comments_template(); ?>
    </div>
    <?php endwhile; else: ?>

    <p><?php _e('אין פה שום דבר כזה.'); ?></p>

    <?php endif; ?>

    </div>
    First, I think that the <?php comments_template(); ?> command must be inside the Loop in order to work.
    second, I've put it in a div with a css class that I created and added to the style.css. so, in fact, you can use the same comments template but put it in a different div and it can look completely different.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.