Forums

Show comments on main index page (2 posts)

  1. ianolsson
    Member
    Posted 3 years ago #

    Hi,

    I am trying to show comments underneath each post on the main index page of my blog.

    Searching the forum shows that i should put <?php comments_template(); ?> in my code before <?php endwhile; ?>
    .

    I have tried doing this and it is not working. Any ideas?

    My index code is below.

    Thanks.

    <?php get_header();?>
    <?php get_sidebar();?>
    <div id="content">
      <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    
    				<div class="entry">
    					<?php the_content(); ?>
    				</div>
    
    				<div class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> on <?php the_time('F j, Y') ?> <!-- | by <?php the_author() ?> -->| <?php edit_post_link('Edit', '', ' | '); ?>  There are currently <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></div>
    
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>
    </div>
    <?php get_footer ();?>
    
    </body>
    </html>
  2. tygern8r
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic