Search code examples
drupaldrupal-7drupal-theming

How to Unset title ('Search results') on Search results page?


How to Unset title ('Search results') on Search results page?

I'm still noobish and I was trying this:

function mymodulename_preprocess_search_result(&$variables) 

{
  $variables['title'] = NULL;
}

Solution

  • You can not change it with a preprocess since the sentence is just a printed string in the template not a variable. So you have to alter the template.

    In the templates folder of your theme, duplicate the template from /root directory of your site/modules/search/search-results.tpl.php.

    And edit this file as you wish.

    The theme template file will be automatically called instead of the one in the core.