Restrict Post Views Counter to Logged in Users

Posted in: Newspaper
Post count: 10

Hello!

Could you tell me if it is possible to restrict the post views counter that appears on every post to logged-in users only?

Thank you in advance for your help!

Post count: 23312

Hello AyaR,

Unfortunately, our theme does not have any such an option for this, sorry! If you want to achieve this feature, you should do it through the code and if you are not aware of the steps which are needed to take in this case, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry! For targeting the current user you can start from the following function, like this -> https://codex.wordpress.org/Function_Reference/current_user_can

Thanks for the message!

Post count: 9544

One option would be to disable the views function from theme panel, and then use the WP-PostViews plugin but edit to use the same datafield/custom field used by the theme (or edit dbase to rewrite to ‘views’); then you’d turn ‘off’ the view on pages option in the plugin, but the views would still show for logged in users.

Simpler than hiring programmer.

OR:
With the theme only, you’d have to disable the code on all templates to keep it live in the admin post index view.

Food for thought anyway.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.