In the past we have shown you 如何创建一个受欢迎的帖子选项卡 in WordPress using a plugin. That plugin works great out the box for tabbers. However, we wanted more customization in our layout, so we decided to do it without a plugin. In this article, we will show you how to track and display popular posts by views in WordPress without using any plugins.
First thing we need to do is create a function that will detect post views count and store it as a custom field for each post. To do this, paste the following codes in your theme’s functions.php file or better in a 特定于站点的插件: