Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

If someone comments on any post on my site, that comment gets displayed under another post.

Moreover, if I login to my site. And click on logout link (under comment section) it redirects me to another article after log out.

One possible reason as I read on many places, may be showing related posts. I am using following code for this

<?php do_action('erp-show-related-posts', array('title'=>'Most Related Post', 'num_to_display'=>10, 'no_rp_text'=>'No relevant article found.')); ?>

Which is basically given by a wordpress plugin efficient related post.

share|improve this question
    
Please re-write your question. We can't figure out what you're asking ... –  EAMann Oct 19 '10 at 20:43

1 Answer 1

up vote 5 down vote accepted

It sounds to me like you mucked up the query and the comment form thinks the user's on the wrong post. Try adding

wp_reset_query();

to your theme right before your theme adds the comment form.

If that doesn't work, do this:

wp_reset_query();
global $post, wp_query;
$post = $wp_query->post;
setup_postdata($post);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.