• Hi,
    Ive been developing a wordpress theme recently, and i’ve mostly got the comments feature working – although “replies” to comments don’t seem to display. They display in the back end, and the post will show “4” comments (for example if there are 3 comments and a reply), however the actual reply doesn’t display underneath its parent comment. Anyone have any ideas what may be causing this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Most likely CSS issue.
    Can you provide a link to your site please?

    Thread Starter Zany90

    (@zany90)

    Below I have included the code in the index.php file and also comments.php .. Sorry this is quite lengthy but I cant really provide the link to the site as the site has been built for someone else so can’t really have comments posted on it as its not actually my site.. Below are my index.php loop and comments.php file… Possibly im missing a line of code to display replies? everything else is working perfectly.

    comments.php

    <?php
    	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if ( post_password_required() ) { ?>
    		<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
    	<?php
    		return;
    	}
    ?>
    
    	<div id="comments">
    	<h3 style="margin-top: 20px; margin-bottom: 20px;"><?php comments_number('No Comments', '1 Comment', '% Comments' );?></h3>
    
    	<?php if ( have_comments() ) : ?>
    
    	<ol class="commentlist">
    		<?php wp_list_comments('avatar_size=64&type=comment'); ?>
    	</ol>
    
    	<style>
    		.commentlist {
    			list-style-type: none;
    		}
    
    		.commentlist li {
    			margin-bottom: 20px;
    			background: #f1f1f1;
    			box-sizing: border-box;
    			padding: 10px;
    		}
    	</style>
    
    	<?php if ($wp_query->max_num_pages > 1) : ?>
    	<div class="pagination">
    		<ul>
    			<li class="older"><?php previous_comments_link('Older') ?></li>
    			<li class="newer"><?php next_comments_link('Newer') ?></li>
    		</ul>
    	</div>
    	<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php if ( comments_open() ) : ?>
    
    	<div id="respond">
    		<h3 style="margin-top: 20px;">Leave a Response</h3>
    
    		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" style="margin-top: 20px;">
    		<fieldset  style="border: none;">
    			<label for="author">Name:</label>
    			<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" /><br />
    
    			<label for="email">Email:</label>
    			<input type="email" name="email" id="email" value="<?php echo $comment_author_email; ?>" /><br />
    
    			<label for="url">Website:</label>
    			<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" /><br />
    
    			<label for="comment">Message:</label>
    			<textarea name="comment" id="comment" rows="" cols=""></textarea><br />
    
    			<input type="submit" class="commentsubmit" value="Submit Comment" id="commentsubmit" />
    
    			<?php comment_id_fields(); ?>
    			<?php do_action('comment_form', $post->ID); ?>
    		</fieldset>
    		</form>
    		<p class="cancel"><?php cancel_comment_reply_link('Cancel Reply'); ?></p>
    	</div>
    		<?php else : ?>
    			<h3>Comments are now closed.</h3>
    	<?php endif; ?>
    	</div>

    The loop from index.php

    <?php if (have_posts ()) : ?>
    			<?php while(have_posts()) : the_post(); ?>
    
    			<?php if(is_sticky()):?>
    				<article id="sticky_post"><?php the_content(); ?></article>
    			<?php elseif(!is_sticky()):?>
    
    				<article class="post">
    					<h2 class="post_title"><a class="blog_titles" style="color: #000000;" href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    
    					<p class="date"><?php the_time('F jS, Y') ?><br />
    					Posted in: <?php the_category(', ') ?><br />
    					<span style="font-style: italic;"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></span></p>
    
    					<div class="grey"><?php the_content(''); ?></div>
    
    					<a href="<?php the_permalink() ?>" class="readmore">Read More...</a>
    				</article>
    
    			<?php endif;?>
    
    			<?php endwhile; ?>
    
    			<ul id="older_newer">
    
    				<li id="older"><?php next_posts_link('Older Posts') ?></li>
    				<li id="newer"><?php previous_posts_link('Newer Posts') ?></li>
    
    			</ul>
    
    			<?php else : ?>
    
    				<h2>Nothing Here!</h2>
    
    			<?php endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Comment replies not displaying’ is closed to new replies.