Take a look at this
-
I have been trying to add the comments box to a page (not posts).
I checked the boxes on the sidebar for allow comments and ping. Didn’t work.
I read in another post to create a new page template for those pages I wanted to have comments on. I did that and chose that template for the page and saved it. The page won’t load. It says error on line 51.
Since I am totally new to WordPress and php I need some help.
Here is the page code I created using the page.php as a start and added the lines for the comments template.
Backticks added as required here to post. They are not part of my page code.<?php /* Template Name: Page With Comments */ ?> <?php get_header(); ?> <div id="content"> <?php include(TEMPLATEPATH."/sidebar.php");?> <div id="contentmiddle"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!-- google_ad_section_start --> <h1><?php the_title(); ?></h1> <?php /* AdSense Code Start */ ?><?php if ($wp_query->current_post == 0) include("first-ad.php"); ?><?php /* AdSense Code End */ ?> <?php the_content(__('Read more'));?> <?php /* Tags WP 2.3 Code Start */ if ( function_exists('is_tag')){ ?> <p><?php the_tags(); ?></p> <?php /* Tags WP 2.3 Code End */ } ?> <!-- <?php trackback_rdf(); ?> --> <!-- google_ad_section_end --> <?php /* AdSense Code Start */ ?><div style="text-align:center; padding-bottom:10px;"> <? include("adsense.php"); ?> <?php InsertAdvert($PageFooter);?> </div><?php /* AdSense Code End */ ?> <?php /* related_posts Start */ ?><?php if (function_exists('related_posts')) { ?><div class="reltpost"> <h3>Related posts to <?php the_title(); ?></h3> <?php related_posts(); ?> </div><?php } ?><?php /* related_posts End */ ?> <h3>Comments on <?php the_title(); ?></h3> <?php comments_template(); ?> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php /* AdSense Code Start */ ?><div style="text-align:center; padding-bottom:10px;"> <? include("adsense.php"); ?> <?php InsertAdvert($PageFooter);?> </div><?php /* AdSense Code End */ ?>
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Take a look at this’ is closed to new replies.