Skip to content

Instantly share code, notes, and snippets.

@victorpavlov
Forked from jacine/template.php
Last active August 29, 2015 14:24
Show Gist options
  • Save victorpavlov/8cdd9c29f7f99ef0e209 to your computer and use it in GitHub Desktop.
Save victorpavlov/8cdd9c29f7f99ef0e209 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_page_alter().
*/
function mytheme_page_alter(&$page) {
// Remove all the region wrappers.
foreach (element_children($page) as $key => $region) {
if (!empty($page[$region]['#theme_wrappers'])) {
$page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region'));
}
}
// Remove the wrapper from the main content block.
if (!empty($page['content']['system_main'])) {
$page['content']['system_main']['#theme_wrappers'] = array_diff($page['content']['system_main']['#theme_wrappers'], array('block'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment