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