Hi, is it possible to limit the post views to users that have author or admin roles, so only they can see them? I’d rather not have the post views public while my site is new and growing, the low view count in the beginning may discourage potential users, however I find it useful to be able to see this myself and my friends who are working on the site with me (to see which type of posts get the most views).
But I can’t find any option in the template to limit who can see the post views, I can only see an on/off switch. Is it possible to fix this with a css or php hack?
Hi,
You can leave post views enable from Theme Panel > Post settings: http://screencast.com/t/q81kFODmHuR and use this css code to hide it on frontend post page: http://screencast.com/t/rT3Qv7IH1 or you can comment(or delete) in code if you edit post template that you use: http://screencast.com/t/nWR3dMIL
You and your friends can see the post view in backend: http://screencast.com/t/pIF0XErmwQ
Hope this helps!
Hmm I tried that and it didn’t seem to change anything. I can only see the back-end view count if I have it enabled, and after adding in that CSS code and changing those .php files I can still see the view count. How can I find out which of those php files apply to my template?
I’d like to make it completely invisible in the front-end, but still be able to see it in the back end (wordpress admin-interface).
Hi,
To achieve that disable the option from theme panel: http://screencast.com/t/ZESWfaKg19
Then remove this condition form td_page_views.php file: http://screencast.com/t/a79segeXTYz
Like this you’ll only see the views columns in admin panel.
Thanks
Hmm now I’m having problems with this. My “most popular last 7 days” widget has stopped working after I made these changes. The view count is going up on the posts, but the list of most popular isn’t changing as a result of that. How do I fix that?
Ok I just changed the custom css and this seems to work, my “most popular” widget is now working again:
.entry-comments-views {
display: none !important;
}
I originally had:
.post .entry-comments-views {
display: none !important;
}
and that seemed to do nothing. Hopefully this won’t have any unintended side-effects!
-
This reply was modified 11 years by
societyofect.