WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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

If that doesn't work, do this:

global $post, wp_query;
$post = $wp_query->post;
share|improve this answer

Your Answer


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.