<?php

/****************************/
/**** Sidebar Secondary  ****/
/****************************/
// -- Get the sidebar for this page/section --
$sidebar = ac_get_right_sidebar();
dynamic_sidebar($sidebar);
 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;
         }
     }
 }
示例#3
0
	          </aside><!-- /.sidebar -->
	        <?php 
}
?>
	
	        <?php 
if (shoestrap_section_class('wrap')) {
    ?>
	            </div>
	          </div>
	        <?php 
}
?>
	
	        <?php 
if (ac_get_right_sidebar()) {
    ?>
 
	          <aside class="sidebar secondary <?php 
    echo esc_attr(ac_get_sidebar_class());
    ?>
 <?php 
    echo esc_attr(shoestrap_section_class('secondary'));
    ?>
 <?php 
    echo esc_attr(ac_get_hide_until_fade_class());
    ?>
" role="complementary">
	            <?php 
    include new Roots_Wrapping('templates/sidebar-secondary.php');
    ?>