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.

  • Please re-write your question. We can't figure out what you're asking ...
    – EAMann
    Oct 19, 2010 at 20:43

1 Answer 1


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;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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