Comments Not Showing Up
-
I’ve just started using wordpress and I thought I’d try my hand at making a theme for my blog. Everything is working fine except the comments. I tested the theme on my personal webserver and it worked but when I uploaded it to my site, the comments are not showing up. It just stays as “There are no comments currently.” SEE HERE. I suspect it might have something to do with the mod-rewrite permalinks (since I had a similar problem with the default wordpress theme which was later resolved by changing the permalink options around). Anyway, if someone can, please help me :/! Your aid is appreciated!
Here’s the code for comments.php:<?php // Do not delete these lines if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); if ( post_password_required() ) { ?> <h5>Comments</h5> <div class="comments">This post is password protected. Enter the password to view comments.</p> <?php return; } ?> <div id="comments"> <h5>Comments</h5> <?php if ($comments) : ?> <?php foreach ($comments as $comment) : ?> <div class="comment" id="comment-<?php comment_ID() ?>"> <?php comment_text() ?> </div> <h4>by <?php comment_author_link() ?> @ <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('d M Y, h:i a') ?></a> <?php edit_comment_link('Edit Comment','',''); ?></h4> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.'); ?></em> <?php endif; ?> <?php endforeach; /* end for each comment */ ?> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <div class="comment">There are currently no comments.</div> <?php else : // comments are closed ?> <div class="comment">Comments are closed.</div> <?php endif; ?> <?php endif; ?> </div> <div id="form"> <?php if ('open' == $post->comment_status) : ?> <h5 id="respond">Leave a Reply</h5> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <div class="comment">You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</div> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if ( $user_ID ) : ?> <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout.</a></p> <?php else : ?> <input type="text" name="author" id="author" size="30" value="<?php if($comment_author == "") echo 'Name'; else echo $comment_author; ?>" onblur="if (this.value == '') {this.value = 'Name';}" onfocus="if (this.value == 'Name') {this.value = '';}" tabindex="1" /> <br /><input type="text" name="email" id="email" size="30" value="<?php if($comment_author_email == "") echo 'E-mail'; else echo $comment_author_email; ?>" onblur="if (this.value == '') {this.value = 'E-mail';}" onfocus="if (this.value == 'E-mail') {this.value = '';}" tabindex="2" /> <br /><input type="text" name="url" id="url" size="30" value="<?php if($comment_author_url == "") echo 'Website'; else echo $comment_author_url; ?>" onblur="if (this.value == '') {this.value = 'Website';}" onfocus="if (this.value == 'Website') {this.value = '';}" tabindex="3" /> <?php endif; ?> <br /><textarea name="comment" id="comment" cols="30" rows="3" tabindex="4"></textarea> <br /><input name="submit" type="submit" id="submit" tabindex="5" value="Add Comment" /> <?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID); ?></form> <?php endif; // If registration required and not logged in ?> <?php endif; // if you delete this the sky will fall on your head ?> </div>
The topic ‘Comments Not Showing Up’ is closed to new replies.