1

How do I hide the "Count content views" of a certain page/node?

I want to hide the numbers of reads along with the date the page was updated without effecting other pages on the site.

0

You need to interact with the theming layer (template.php in theme)

As you want to alter an element within a node, you may use function template_preprocess_node(&$variables) to alter, remove or disable that element. You will need to do a conditional test first ($variables['node']->nid) and check $node->nid against the nid of your specific node page. You can then look for the element within $node.

You may also just use Drupal 7 Template (Theme Hook) Suggestions, if the element you wish to hide is a standalone element (ie not embedded in a larger render array), in which case you will copy over the base theme's node template and just comment out/alter the bit in question - for node it is node--[type|nodeid].tpl.php.

When working in the theme layer remember that your theme always has the last say so you can safely make alterations knowing that you cannot cause problems for any other modules or base themes in the process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.