Title: Comments Submitted to Wrong Post
Last modified: August 20, 2016

---

# Comments Submitted to Wrong Post

 *  [truevoyage](https://wordpress.org/support/users/truevoyage/)
 * (@truevoyage)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/comments-submitted-to-wrong-post/)
 * I’ve developed my own theme from scratch.
    – New comments are posted to the wrong
   post. – And after submitting a new comment visitors are diverted to a different
   post.
 * An example of one of my posts is: [http://www.truevoyage.com/db/thailand/koh-tao/muay-thai-boxing-training.html](http://www.truevoyage.com/db/thailand/koh-tao/muay-thai-boxing-training.html)
 * Does anyone know how I can fix this? Thanks in advance.
 * —
    Not sure if this info will help. I call my comments as part of my footer.php
   file
 *     ```
       <?php $comments_args = array(
               'title_reply'=>'Submit A Comment',
               'comment_notes_after' => '',
       	'comment_notes_before' => '');
   
       comment_form($comments_args); ?>
       ```
   
 * My main index file is very simple [and I don’t use single.php – all posts use
   the index.php]
 *     ```
       <?php get_header(); ?>
       <?php if (have_posts()) :
       while (have_posts()) :
       the_post(); ?>
       <?php the_content(); ?>
       <?php endwhile; else: ?>
       <p>Sorry, no posts we're found.</p>
       <?php endif; ?>
       <?php get_footer(); ?>
       ```
   
 * My comments.php looks like this:
 *     ```
       <ul style="list-style: none; padding:0; margin:0;">
        <?php wp_list_comments( 'callback=garytheme_comments' ); ?> 
   
       <div class="comments-nav"><?php paginate_comments_links('prev_text= &next_text= ') ?> </div>
       ```
   
 * Where the function called is in my functions.php file:
 *     ```
       function garytheme_comments($comment, $args, $depth) {
       		$GLOBALS['comment'] = $comment;
       		extract($args, EXTR_SKIP);
       ?>
   
       <li><div id="div-comment-<?php comment_ID() ?>" class="comment-body">
       		<div>
       		<div class="comml"><?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?></div>
       		<div class="commr">Posted <?php comment_date('j-M-Y'); ?></div>
       		</div>
       <div class="comcom"><?php if ($comment->comment_approved == '0') : ?>
       		<em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?>
   
       <?php endif; ?>
       		<?php comment_text() ?></div>
       		</div>
       <?php
               }
       ```
   
 * _[please remember to mark any posted code – [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)–
   the above codes might be broken/corrupted by the forum parser]_

The topic ‘Comments Submitted to Wrong Post’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [comments.php](https://wordpress.org/support/topic-tag/comments-php/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [wrong post](https://wordpress.org/support/topic-tag/wrong-post/)

 * 0 replies
 * 1 participant
 * Last reply from: [truevoyage](https://wordpress.org/support/users/truevoyage/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/comments-submitted-to-wrong-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
