Deleting a variable from the page template

Public

Removing the search box or RSS icon on the front page.

</> CopyGet raw version
php
  1. </php
  2.  
  3. /**
  4.  * Override or insert variables into the page templates.
  5.  *
  6.  * @param $vars
  7.  * An array of variables to pass to the theme template.
  8.  * @param $hook
  9.  * The name of the template being rendered ("page" in this case.)
  10.  */
  11. function mytheme_preprocess_page(&$vars, $hook) {
  12. // Do not display the search box or RSS icon
  13. // if this is the front page.
  14. if ($vars['is_front']) {
  15. unset($vars['search_box']);
  16. unset($vars['feed_icons']);
  17. }
  18. }