I am now experiencing a wired problem with my wordpress installation. I was surprised when I saw post view counter of another post also increased including the the post on which I clicked to try and check the result. I also observed that it increments the post view of another post from the same user.
For more information: I am calling a function from single.php while passing post id to it to display post counter at the bottom of post. In order to trace the issue I used netbeans IDE and found that single.php runs more than once and it passes different post id at first run and subsequently it passes correct post id at the end.
In order to get post id on single.php I used:
<?php $newpostid = get_the_ID(); ?>
Total Views <?php echo_views($newpostid); ?
echo_views() is a function which directly used to output the updated number using echo statement within it.
Hope someone can help me out of this issue. Thanks.