Skip to content

Instantly share code, notes, and snippets.

@fovoc
Created June 17, 2013 12:09
Show Gist options
  • Save fovoc/5796420 to your computer and use it in GitHub Desktop.
Save fovoc/5796420 to your computer and use it in GitHub Desktop.
shoestrap v1.51 - Hero visibility setting not working when hero contains other widgets
<?php
get_template_part('templates/head');
$layout = get_theme_mod( 'shoestrap_layout' );
?>
<body <?php body_class(); ?>>
<!--[if lt IE 7]><div class="alert">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</div><![endif]-->
<?php
do_action('get_header');
// Use Bootstrap's navbar if enabled in config.php
if (current_theme_supports('bootstrap-top-navbar'))
get_template_part('templates/header-top-navbar');
?>
<?php
// Load the extra branding area
do_action('shoestrap_branding');
// load the shoestrap hero area
do_action('shoestrap_hero');
?>
<?php
// load the secondary navbar if one is selected in the customizer
if ( get_theme_mod( 'shoestrap_navbar_secondary' ) == 1 )
get_template_part('templates/navbar');
?>
<?php
is_front_page() ? $is_front_page=true : $is_front_page=false ;
$hero_visibility = get_theme_mod( 'shoestrap_hero_visibility' );
if (( is_active_sidebar('hero-area') && $hero_visibility == 'front' && $is_front_page == true ) ||
( is_active_sidebar('hero-area') && $hero_visibility == 'site' ))
dynamic_sidebar( 'hero-area' );
?>
<?php do_action('shoestrap_pre_wrap'); ?>
<div id="wrap" class="<?php shoestrap_fluid_body_classes( 'container' ); ?>" role="document">
<?php do_action('shoestrap_pre_content'); ?>
<div id="content" class="<?php shoestrap_fluid_body_classes( 'row' ); ?>">
<?php if ( in_array ( $layout, array ( 'mps', 'pms', 'smp', 'spm' ) ) && shoestrap_display_sidebar() && shoestrap_display_primary_sidebar() ) { ?>
<div class="m_p_wrap <?php shoestrap_sidebar_class_calc( 'main-primary', '', true ); ?>">
<div class="row-fluid">
<?php } ?>
<?php do_action('shoestrap_pre_main'); ?>
<div id="main" class="<?php echo shoestrap_main_class(); ?>" role="main">
<?php include shoestrap_template_path(); ?>
</div>
<?php do_action('shoestrap_after_main'); ?>
<?php if (shoestrap_display_sidebar() && shoestrap_display_primary_sidebar()) : ?>
<?php if ( !in_array ( $layout, array ( 'm', 'ms', 'sm' ) ) ) { ?>
<aside id="sidebar" class="<?php echo shoestrap_sidebar_class(); ?>" role="complementary">
<?php do_action('shoestrap_pre_sidebar'); ?>
<?php get_template_part('templates/primary-sidebar'); ?>
<?php do_action('shoestrap_after_sidebar'); ?>
</aside>
<?php } ?>
<?php if ( in_array ( $layout, array ( 'mps', 'pms', 'smp', 'spm' ) ) && shoestrap_display_sidebar() && shoestrap_display_primary_sidebar() ) { ?>
</div></div>
<?php } ?>
<?php if ( !in_array ( $layout, array ( 'm', 'mp', 'pm' ) ) && shoestrap_display_sidebar() && shoestrap_display_secondary_sidebar() ) { ?>
<aside id="secondary" class="<?php echo shoestrap_sidebar_class( 'secondary' ); ?>" role="complementary">
<?php do_action('shoestrap_pre_sidebar'); ?>
<?php get_template_part('templates/secondary-sidebar'); ?>
<?php do_action('shoestrap_after_sidebar'); ?>
</aside>
<?php } ?>
<?php endif; ?>
</div><!-- /#content -->
<?php do_action('shoestrap_after_content'); ?>
</div><!-- /#wrap -->
<?php do_action('shoestrap_after_wrap'); ?>
<?php do_action('shoestrap_pre_footer'); ?>
<?php get_template_part('templates/footer'); ?>
<?php do_action('shoestrap_after_footer'); ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment