css for hiding view counter on certain posts

Posted in: Newspaper
Post count: 16

Hi, is there any css to avoid / hide the amount of views of certain posts?

thanks!

Rod

Post count: 23312

Hello rodmvin,

If you want to hide the post views counter for a certain post, you have to use a bit of CSS to hide it by a certain post ID, like this -> http://screencast.com/t/DqmlZAgvI

The code is ->

.postid-146 .td-post-views {
display:none;
}

Thanks.

Post count: 16

Hi Catalin,

Thanks for your answer. Did work perfectly. I would like to go a bit further with my question: Is is possible to hide the posts view counter using as a parameter a category? If so, I would not have to add the css for each post im adding to the site. Something like:

.category-999 .td-post-views {
display:non;
}

in this case I would put this css code on the theme painel css box, rather than in each post css custom configuration.

Thanks !

Post count: 23312

Hello rodmvin,

Unfortunately, our theme does not have such an option and please notice that is not a simple task. If you want to hide the post views for some posts which are included in a certain category, you have to alter the code from core file where the function is created and you will add some conditions in order to achieve as you wish. You have to do changes in this file -> http://screencast.com/t/itsnHBXP As a hint, you should use in_category() by category ID. For more references about this, please check the codex here -> https://developer.wordpress.org/reference/functions/in_category/
If you want to display more levels in our theme and you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment. Usually, we recommend the developers from studio.envato.com

Thank you for your understanding!

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