Title: comment-template.php Help
Last modified: August 19, 2016

---

# comment-template.php Help

 *  [ste9890](https://wordpress.org/support/users/ste9890/)
 * (@ste9890)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/comment-templatephp-help/)
 * Not sure if this is in the right section but here goes:
 * In the comments on my blog, when I click ‘reply’ to a post the page refreshes
   with the query string in the address bar (?replytocom=24#respond) and it doesn’t
   move the comment form up to the right place – it just stays at the bottom. However
   the form h3 does change to ‘Leave a Reply to [correct username]’.
 * In my functions.php, if I change the id of the comment li from ‘li-comment-<?
   php comment_ID(); ?>’ to just ‘comment-<?php comment_ID(); ?>’ it then solves
   the problem. BUT this then means the comment form h3 doesnt change to ‘Leave 
   a Reply to [correct username]’, it just stays as ‘Leave a Reply’.
 * I hope that makes sense!
 * Can anyone help me? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/comment-templatephp-help/#post-1877300)
 * just wondering why there is ‘li-comment-<?php comment_ID(); ?>’ in your functions.
   php in the first place;
 * instead of changing it, you might be able to add ‘comment-<?php comment_ID();?
   >’
 * (details depend on the exact code of this area – if you like you can paste the
   code of your functions.php into a [http://wordpress.pastebin.com/](http://wordpress.pastebin.com/)
   and post the link to it here)
 * if you are working with a free theme, you can post the name and dwonload link
   of this theme here as well.
 *  Thread Starter [ste9890](https://wordpress.org/support/users/ste9890/)
 * (@ste9890)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/comment-templatephp-help/#post-1877421)
 * Thanks for your reply.
 * I’m using the Starkers theme: [http://starkerstheme.com/](http://starkerstheme.com/)
 * The code for the comments is in functions.php. The comments function is as follows:
 *     ```
       if ( ! function_exists( 'twentyten_comment' ) ) :
   
       function twentyten_comment( $comment, $args, $depth ) {
       	$GLOBALS['comment'] = $comment;
       	switch ( $comment->comment_type ) :
       		case '' :
       	?>
       	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
       		<div id="comment-<?php comment_ID(); ?>">
       		<div class="comment-author vcard">
       			<?php echo get_avatar( $comment, 40 ); ?>
       			<?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
       		</div><!-- .comment-author .vcard -->
       		<?php if ( $comment->comment_approved == '0' ) : ?>
       			<em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
       			<br />
       		<?php endif; ?>
   
       		<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
       			<?php
       				/* translators: 1: date, 2: time */
       				printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
       			?>
       		</div><!-- .comment-meta .commentmetadata -->
   
       		<div class="comment-body"><?php comment_text(); ?></div>
   
       		<div class="reply">
       			<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
       		</div><!-- .reply -->
       	</div><!-- #comment-##  -->
   
       	<?php
       			break;
       		case 'pingback'  :
       		case 'trackback' :
       	?>
       	<li class="post pingback">
       		<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
       	<?php
       			break;
       	endswitch;
       }
       endif;
       ```
   
 * You can see that the first two lines of the html are an li with id=”li-comment-
   <?php comment_ID(); and a div with id=”comment-<?php comment_ID(); ?>”.
 * This all works correctly, apart from when you click reply to a particular post…
   the form header doesn’t change to ‘Leave a Reply to [correct username]’.
 * Curiously, if I change the id of the div to “li-comment-<?php comment_ID(); ?
   >” it does change the form header appropriately. But then the form isn’t moved
   up to the correct comment!
 *  Thread Starter [ste9890](https://wordpress.org/support/users/ste9890/)
 * (@ste9890)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/comment-templatephp-help/#post-1877575)
 * Bump!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘comment-template.php Help’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [starkers](https://wordpress.org/support/topic-tag/starkers/)

 * 3 replies
 * 2 participants
 * Last reply from: [ste9890](https://wordpress.org/support/users/ste9890/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/comment-templatephp-help/#post-1877575)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
