Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My theme does not seem to be showing me the comments section, this is the PHP code I have in my index.php file inside the template folder

<!-- Start the Loop. -->
<?php get_header(); ?>

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

 <!-- Test if the current post is in category 3. -->
 <!-- If it is, the div box is given the CSS class "post-cat-three". -->
 <!-- Otherwise, the div box is given the CSS class "post". -->
 <?php if ( in_category('3') ) { ?>
           <div class="post-cat-three">
 <?php } else { ?>
           <div class="post">
 <?php } ?>

 <!-- Display the Title as a link to the Post's permalink. -->
 <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

 <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
 <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

 <!-- Display the Post's content in a div box. -->
 <div class="entry">
   <?php the_content(); ?>
 </div>

 <!-- Display a comma separated list of the Post's Categories. -->
 <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
 </div> <!-- closes the first div box -->

 <!-- Stop The Loop (but note the "else:" - see next line). -->
 <?php endwhile; else: ?>

 <!-- The very first "if" tested to see if there were any Posts to -->
 <!-- display.  This "else" part tells what do if there weren't any. -->
 <p>Sorry, no posts matched your criteria.</p>

 <!-- REALLY stop The Loop. -->
 <?php endif; ?>
share|improve this question
    
Hi and welcome! Did you compare your theme with another one that has comments section? The Codex may be helpful: Theme_Development and Template_Hierarchy. –  brasofilo Jan 17 '13 at 1:37

1 Answer 1

up vote 0 down vote accepted

if you look in the twentyTwelve theme. you can see how they get the comments. Look in the full-width.php file and you can see this code

 <?php comments_template( '', true ); ?>

this will call the code to get your comments section. Now you must make sure that your theme has the comments.php. You can also check twentyEleven and twentyTen theme to see the different methods

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.