function shoestrap_section_class($target, $echo = false) { global $redux; $layout = shoestrap_getLayout(); $first = intval(shoestrap_getVariable('layout_primary_width')); $second = intval(shoestrap_getVariable('layout_secondary_width')); // disable responsiveness if layout is set to non-responsive $base = shoestrap_getVariable('site_style') == 'static' ? 'col-xs-' : 'col-sm-'; // AC - Super sidebars $first_sidebar = ac_get_left_sidebar(); $second_sidebar = ac_get_right_sidebar(); // Set some defaults so that we can change them depending on the selected template $main = $base . 12; $primary = NULL; $secondary = NULL; $wrapper = NULL; if (is_active_sidebar($first_sidebar) && is_active_sidebar($second_sidebar)) { if ($layout == 5) { $main = $base . (12 - floor(12 * $first / (12 - $second))); $primary = $base . floor(12 * $first / (12 - $second)); $secondary = $base . $second; $wrapper = $base . (12 - $second); } elseif ($layout >= 3) { $main = $base . (12 - $first - $second); $primary = $base . $first; $secondary = $base . $second; } elseif ($layout >= 1) { $main = $base . (12 - $first); $primary = $base . $first; $secondary = $base . $second; } } elseif (!is_active_sidebar($second_sidebar) && is_active_sidebar($first_sidebar)) { $main = $base . (12 - $first); $primary = $base . $first; } elseif (is_active_sidebar($second_sidebar) && !is_active_sidebar($first_sidebar)) { $main = $base . (12 - $second); $secondary = $base . $second; } if ($target == 'primary') { $class = $primary; } elseif ($target == 'secondary') { $class = $secondary; } elseif ($target == 'wrapper') { $class = $wrapper; } else { $class = $main; } if ($target != 'wrap') { // echo or return the result. if ($echo) { echo $class; } else { return $class; } } else { if ($layout == 5) { return true; } else { return false; } } }
<?php /**************************/ /**** Sidebar Primary ****/ /**************************/ // -- Get the sidebar for this page/section -- $sidebar = ac_get_left_sidebar(); dynamic_sidebar($sidebar);
echo 'id="home-blog"'; } ?> role="main"> <?php include roots_template_path(); ?> </main><!-- /.main --> <?php do_action('shoestrap_after_main'); ?> <?php if (ac_get_left_sidebar()) { ?> <aside class="sidebar primary <?php echo esc_attr(ac_get_sidebar_class()); ?> <?php echo esc_attr(shoestrap_section_class('primary')); ?> <?php echo esc_attr(ac_get_hide_until_fade_class()); ?> " role="complementary"> <?php include new Roots_Wrapping('templates/sidebar.php'); ?> </aside><!-- /.sidebar -->