How to track & show WordPress post views without a plugin

Snippets WordPress
Please Rate this ..

This simple snippet tracks and shows WordPress post views in your templates – and without the need for a plugin.

Instructions
Add this to your functions.php file.

Add this to your single.php , and make sure you paste in inside the loop.

To display the number of views a post has, just add this in your template where you want the post view count to be displayed.

Related Links:
http://wpsnipp.com/index.php/functions-php/track-post-views-without-a-plugin-using-post-meta/

1
Leave a Reply

avatar
0 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
  Subscribe  
newest oldest most voted
Notify of