0

Track post views without a plugin in WordPress

Track post views without a plugin in Wordpress

Track post views without a plugin in WordPress. WordPress is the most popular cms in now these days becasue it’s easy to maintain and number of plugins avaliable in the wordpress repostery. Today i am going to share a simple code for wordpress by using that code you can count the number of view for a particular post. Following code help to track the visiotor on you blog or post.To accomplished this i have created to function like following you can see add these function in your functions.php file.

functions.php Code

After adding the code in your functions.php file now you need to do call icodehub_setPostViews() function in you single.php file to calculate the post view.just add the following code in the wordpress loop on single.php file.

single.php file

Now you can add the following function in wordpress loop in any file to display the post view

Show post view in admin

Sandeep Kumar

Sandeep kumar is a web developer and a professinal blogger. He works for latest technologies and write articles what he learn. In ICodeHub he share web languages tutorials and other programming tips and tricks. if you need some help or have some suggestion then mail him at sandeep92pal@gmail.com without any hesitation. He believes in learning and sharing.