How to Display Post View Count
Add this to single.php, and make sure you paste in inside the loop. <?php setPostViews(get_the_ID()); ?> Lastly, to display the number of views a post has, just add this where you want it to be displayed: <?php echo getPostViews(get_the_ID()); ?> . <?php // function to display number of posts. function getPostViews($postID){ $count_key = ‘post_views_count’; $count … Read more