WordPress.org

Forums

Can see comment form, but can't see comments. (1 post)

  1. baduist3
    Member
    Posted 7 years ago #

    Hi.
    For some reason, i can't see any comments on single posts on my site.
    The form is there, and it works. i can see comments through the admin panel, and approve them. I can even see the correct count of comments on the page, but i don't see the actual comments.

    This is how my comments.php looks like:

    <h3 class="where">
                            <span class="fRight">Posted in <?php the_category(', '); ?></span>
                            <strong><?php comments_number('no comments', '1 comment', '% Comments so far'); ?></strong></h3>
    
    			<ol id="comments">
    <?php if ($comments) : ?>
    <?php foreach ($comments as $comment) : ?>
    				<li id="comment-<?php comment_ID() ?>">
    					<div class="commentmetadata"><span class="commentAuthor"><?php comment_author_link(); ?></span> <?php comment_time('d M y'); ?> </div>
    					<p><?php comment_text() ?></p>
    				</li>
    <?php endforeach; ?>
    <?php else : // If there are no comments yet ?>
    	<li>No comments yet...</li>
    <?php endif; ?>
    			</ol>
    			<div class="comment">
    				<h2 id="postcomment">Post a comment</h2>
    				<form id="commentform" method="post" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php">
    					<p>
    						<label for="author"><small><strong><span>*</span>Name</strong></small></label>
    						<input type="text" tabindex="1" value="<?php echo $comment_author; ?>" id="author" name="author"/>
    					</p>
    					<p>
    						<label for="email"><small><strong><span>*</span>Email</strong></small></label>
    						<input type="text" tabindex="2" value="<?php echo $comment_author_email; ?>" id="email" name="email"/>
    						will not be published</p>
    					<p>
    						<label for="url"><small>Website</small></label>
    						<input type="text" tabindex="3" value="<?php echo $comment_author_url; ?>" id="url" name="url"/>
    					</p>
    					<p>
    						<label for="comment"><small><strong><span>*</span>Comments:</strong></small></label>
    						<textarea tabindex="4" cols="" rows="5" id="comment" name="comment"></textarea>
    					</p>
    					<p>
    						<input type="submit" class="signUpBut" tabindex="5" id="submit" name="submit" value="Submit"/>
    						<input type="hidden" value="<?php echo $id; ?>" name="comment_post_ID"/>
    					</p>
    				</form>
    			</div>
    			<!--/comment -->

Topic Closed

This topic has been closed to new replies.

About this Topic