Modify theme layout in Hybrid Core
Here’s how to modify the Theme Layouts extension in Hybrid Core:
in functions.php
:
<?php
/**
* Modifies the theme layout
*
* @access public
* @param string $layout
* @return string
*/
function infusion_mod_theme_layout( $layout ) {
if (is_page_template( 'page-templates/landingpage.php' ) ) {
$layout = '1c';
}
return $layout;
}
add_filter( 'theme_mod_theme_layout', 'infusion_mod_theme_layout', 15 );
?>
You can then hide sidebars and such like so:
in a sidebar template:
<?php if ( !in_array( get_theme_mod( 'theme_layout' ), array( '1c', '1c-narrow' ) ) ) : ?>
<aside <?php hybrid_attr( 'sidebar', 'primary' ); ?>>
<?php if ( is_active_sidebar( 'primary' ) ) : ?>
<?php dynamic_sidebar( 'primary' ); ?>
<?php endif; ?>
</aside>
<?php endif; ?>