Support » Fixing WordPress » how can I add a comment field to each new page I make?

  • I have a blog going and it works well, but you can only leave comments on the main page of it. I have other pages but people can only read them and then they have to return to the main page to leave a comment.

    How can I have a comment field on each new page that I create??

Viewing 6 replies - 1 through 6 (of 6 total)
  • put in page.php where you want your comments this code:

    <?php comments_template(); ?>

    Thread Starter aprotector

    (@aprotector)

    okay, I’ll give that a shot…thanks.

    Thread Starter aprotector

    (@aprotector)

    okay, that worked for the comment section showing up but it is much wider and not alligned in the same way as the one on the main page. Is there a layer tag that I need to put it in or some way to adjust it so that it is placed in the same location as the one on main page and also so that it is the same width as that one??

    I messed around a bit and came up with this:

    `<?php get_header(); ?>

    <div id=”content”>

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

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2><?php the_title(); ?></h2>
    <div class=”entry”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>

    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

    </div>
    </div>

    <?php endwhile; endif; ?>

    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>

    <!– New comment code part –>

    <table width=”100%” border=”0″ celpadding=”0″>
    <tr>
    <td width=”450″ align=”left” valign=”top”>
    <?php comments_template(); ?>
    </td>
    </tr>
    </table>

    <!– end new part –>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>`

    Just adjust the td width=”450″ to the width that suits you best.

    I too need to add comment capability to my Pages.
    The above looks like a self contained .php script.
    For a .php novice, where exactly in page.php do I put the code?
    Does it replace the whole page.php?
    The existing page.php already has a <?php and ?>. I’m confused as to how to add the above code.

    I’m having the opposite problem that aprotector had. My comment field is too narrow, and I too want it to fit within the confines of the template’s middle column.

    Here’s another funny thing – I inserted just as openpundit suggested the string <?php comments_template(); ?>
    in the page.php file. Howerver although that worked and my pages are now able to receive comments, I just looked at that file again and the string is missing. Again, it’s working but the string disappeared.

    Any help will be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how can I add a comment field to each new page I make?’ is closed to new replies.