Recently I started working on a custom design for this website, using the socialMe theme from MyThemeShop. While I was looking around in the code, to see what does what and alter it to match my needs, I found a script, that collects page views for each post separately. Although, they are not used anywhere. This might be for a future feature from MyThemeShop, not sure. If you happen to know they are there for, please let me know in the comments down below. Display Post Views in MyThemeShop Themes After tinkering around with it for a while, I had the idea of creating a function, that can display these post views now that they are already there and being collected. So in this article, I’m going to show you how to display post views in MyThemeShop themes. If you’re not using a MyThemeShop theme, then check this post on how to display post views in WordPress. Let’s get started with the tutorial, shell we? Creating a function to retrieve the post views First off, the post views are stored under two different names in the database for whatever reason. One of them is _mts_view_count and the second on is _wpt_view_count . Both store the same value and can be found in the wp_postmeta
Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.