WordPress.org

Ready to get started?Download WordPress

Forums

Comments not displaying, can't work out why! (3 posts)

  1. jgclifton
    Member
    Posted 4 years ago #

    Hi there,

    I've made my wordpress theme and made a custom loop for showing my content however, I cannot get comments displaying, I'm sure it must be something simple that I have overlooked. The code is as follows:

    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    
        <div class="content">
            	<div class="contenttopbottom">
    			<?php the_time('F jS, Y') ?> by <?php the_author() ?>
                <div class="comments">
    			<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>
                </div>
    
                <h1><?php the_title(); ?></h1>
                <?php the_content(''); ?>
    
                <div class="contenttopbottom">
    				<?php if( strpos( $post->post_content , "<!--more-->" ) != false ) { ?>
    				<a href="<?php the_permalink(); ?>">Read more</a>
                    <?php } ?>
    			</div>
    
        <?php comments_template(); // Get wp-comments.php template ?>
        	</div>
    
    <?php endwhile;?>
    
    <?php else : ?>
    
    <?php endif; ?>
  2. esmi
    Forum Moderator
    Posted 4 years ago #

    What template file is this code in?

    Oh - and please don't bump posts.

  3. jgclifton
    Member
    Posted 4 years ago #

    This is in Index.php, any help is much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.