An issue with comments
-
Hey – I’m hoping someone can help me out with this odd issue.
I’m working on a hobby blog. On the front page of the blog, at each individual post, the comments link goes to the site url/#respond which doesn’t lead to the comment box. It’s only when you click the post title, going to the full post, that you can click the comment link to go to the commment box.
Since most of my posts will show the full post and not an excerpt, I’m afraid this will create confusion – people won’t be able to comment because they’ll not know to click the post title first.
Any clues?
Thanks!
-
I have seen this too (with the only difference is that it does the same thing from the single post page too), and at least in my case the “#respond” anchor tag seems to work okay, from both the front and single post pages, only if there are already comments present for the post. (You can try this out with a test comment to see if you have similar issue).
Cheers.Actually, I’d already tried what you just suggested – but thanks! Still, no solution.
Make sure your theme’s comments.php file has the anchor label “respond” – something like <h3 id=”respond”>Leave a reply</h3>. Without it the anchor link “#respond” in your front page cannot locate the header “Leave a reply” of your comment box. I just noted that my theme’s comments.php file did not have it, which explains why I had the same problem from both the front and single post page. The problem was gone after I added this label.
Cheers.hmmm… I don’t see that in my comments.php file
<?php /** * @package WordPress * @subpackage Default_Theme */ // 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() ) { ?> <p class="nocomments">This post is password protected. Enter the password to view comments.</p> <?php return; } ?> <?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <!-- You can start editing here. --> <?php if ( have_comments() ) : ?> <div class="post-info-wrap" style="margin-top: 20px;"> <img src="<?php bloginfo('template_directory'); ?>/images/home-title-2-left-<?php echo $artsee_ebusiness_color; ?>.gif" alt="home title" class="home-title-image" /> <span class="post-info"><?php comments_number('No Responses', 'One Response', '% Responses' );?></span> <img src="<?php bloginfo('template_directory'); ?>/images/home-title-2-right-<?php echo $artsee_ebusiness_color; ?>.gif" alt="home title" class="home-title-image" /> </div> <div class="navigation"> <div class="alignleft"><?php previous_comments_link() ?></div> <div class="alignright"><?php next_comments_link() ?></div> </div> <ol class="commentlist"> <?php wp_list_comments('avatar_size=42'); ?> </ol> <div class="navigation"> <div class="alignleft"><?php previous_comments_link() ?></div> <div class="alignright"><?php next_comments_link() ?></div> </div> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="nocomments">Comments are closed.</p> <?php endif; ?> <?php endif; ?> <?php if ('open' == $post->comment_status) : ?> <div id="respond"> <div class="post-info-wrap"> <img src="<?php bloginfo('template_directory'); ?>/images/home-title-2-left-2-<?php echo $artsee_ebusiness_color; ?>.png" alt="home title" class="home-title-image" /> <span class="post-info"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></span> <img src="<?php bloginfo('template_directory'); ?>/images/home-title-2-right-<?php echo $artsee_ebusiness_color; ?>.gif" alt="home title" class="home-title-image" /> </div> <div class="cancel-comment-reply"> <small><?php cancel_comment_reply_link(); ?></small> </div> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p> <?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 wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out »</a></p> <?php else : ?> <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p> <?php endif; ?> <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>--> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', $post->ID); ?> </form> <?php endif; // If registration required and not logged in ?> </div> <?php endif; // if you delete this the sky will fall on your head ?>
Looks like your comment form does not have a header. Do this (after backing up your original comments.php file): add “<h3 id=”respond”>Leave a comment:</h3>” (minus outside quotes) at the top of your comment form, right after the line “<?php if ( $user_ID ) : ?>”. This will add a standard header for your comment box (you can customize it to suit your taste) and also link it to your original anchor tag with the ID “respond”.
Cheers.Hey, manojit – I appreciate you taking the time to help me out. Unfortunately your solution didn’t work.
Maybe I haven’t been clear with this issue so here is the URL I’m working with:
https://allthings80s.laurelanne.com/
As you can see, if you click on “no comments” or “one comment” the link takes you nowhere. Using the second post on the page as an example, it should go to https://allthings80s.laurelanne.com/?p=32#respond but it doesn’t. I’m having to code the link by hand at the bottom of the post.
Odd in that I’ve never seen a theme perform this way.
For some reason I cannot access your URL (get a “cannot find server” error). It is possible your theme is screwing up something somewhere (although I would trust WordPress’s default theme in such matters over any other).
that’s odd… but it’s back.
I was having this same problem, only on mine the permalinks for the entry weren’t working either. We finally figured out that changing the permalink settings from name, date to number fixed the comment link and the permalink problems. No idea why!
- The topic ‘An issue with comments’ is closed to new replies.