Override Page.Tpl For Specific Content Type in Drupal 7


Sometimes there is a need to override page.tpl.php for specific content type. Like for articles it will be page--article.tpl.php etc.

For this, place this code in your theme's template.php file

<?php
function themeName_preprocess_page(&$vars, $hook) {
  if (isset($vars['node'])) {
    // If the node type is "product" the template suggestion will be "page--product.tpl.php".
    $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;
  }
}
?>