Comments & Pages

I wrote on this earlier but felt I could go into more detail as I only link referenced.

Here’s a quick way to add a comments function to the bottom of the content on any pages.

Open the page.php file in your themes folder.

Locate the following code

<?php the_content() ?>

Note that there may be things inbetween <?php and the remainder, so search line by line.

Now follow it through its <div> closures, if you do not place the code after the <div> closures it will have an impact on your layout.

Here is an example of the <div> closures:

<?php if (is_search()) the_excerpt(); else the_content(__(’Read the rest of this entry &raquo;’, ‘kubrick’)); ?>
</div>
<div class=”cleared”></div>
<?php comments_template(); ?>
<?php ob_start(); ?>

As seen above, add the following code. Thats it!

<?php comments_template(); ?>

If you don’t want a particular page to have comments, you will be able to uncheck this when editing the page, just the same as posts.

Leave a Reply

Authors & Contributors Login:
User:
Password:

| Lost password?

Advertisement