Is there anyway to show in a template for a post, how many times that post has been viewed, like hits without some sort of plugin? It seems wordpress would have this built in, but I am unable to find any template tags for such a think in the documentation?
Leave a Reply
You must be logged in to post a comment.
Not in core. You can use post meta to store this information on page loads. If you have caching plugins enabled, you might want to increment the hit counter with an AJAX call, otherwise you can just add this directly in your single.php and page.php templates:
No, WP doesn’t have such functionality built-in. Probably because updating the post table on each page hit would slow down the site.
You’ll have to use wp-postviews or something related.