Forums
Forums / Themes and Templates / Comments Submitted to Wrong Post
(@truevoyage)
13 years, 7 months ago
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
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.ww.wp.xz.cn/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.
(@truevoyage)
13 years, 7 months ago
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
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
My main index file is very simple [and I don’t use single.php – all posts use the index.php]
My comments.php looks like this:
Where the function called is in my functions.php file:
[please remember to mark any posted code – http://codex.ww.wp.xz.cn/Forum_Welcome#Posting_Code – the above codes might be broken/corrupted by the forum parser]