3

I'm building a drupal 7 bootstrap sub theme and want to hide the title of the nodes if there on the home page. I don't want to use css as its only hiding it I want to have the titles not render at all.

i have tried hook_preprocess_page() but didnt work:

function mytheme_preprocess_page(&$vars) {
    if ($vars['is_front']) {
        $vars['title'] = '';
    }
}
4

Your close with hook_preprocess_page() but as you want to hide the node title (and not the page title) you need to use hook_preprocess_node() instead.

0

Going via hook_preprocess_page() this one worked for me:

function MYTHEME_preprocess_page(&$vars) {
  if( drupal_is_front_page() ) drupal_set_title('');
}

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.