Strange number of views for Draft post
-
I am using the following code inside my posts to display the total number of visits:
<?php echo number_format(wp_statistics_pages(total,wp_statistics_get_uri(),wp_statistics_uri_to_id(wp_statistics_get_uri())));?>
If there is a simpler version of the function, please do let me know.
The problem that I am facing is that when I am making a post in Draft mode and I preview the post, the number of views displayed is 1,257 views, which does not change every-time I preview the post. this sounds for me like a normal behavior due to not having the post published yet. However, after I publish the post and I view the post, it still shows 1,257 views. I would have to refresh the post so that I get 1 view. Please let me know if this is how the function is designed to work.
Many thanks.
- The topic ‘Strange number of views for Draft post’ is closed to new replies.