예제 #1
0
 function stachestack_section_class($target, $echo = false)
 {
     global $redux, $ss_framework;
     // Disable the wrapper by default
     $wrapper = NULL;
     if (stachestack_display_primary_sidebar()) {
         // Both sidebars are displayed
         if (stachestack_display_secondary_sidebar()) {
             if (is_page_template('template-5.php')) {
                 $main = $ss_framework->column_classes(array('medium' => 8), 'string');
                 $primary = $ss_framework->column_classes(array('medium' => 4), 'string');
             } else {
                 $main = $ss_framework->column_classes(array('medium' => 7), 'string');
                 $primary = $ss_framework->column_classes(array('medium' => 3), 'string');
             }
             $secondary = $ss_framework->column_classes(array('medium' => 2), 'string');
             if (is_page_template('template-5.php')) {
                 $wrapper = $ss_framework->column_classes(array('medium' => 10), 'string') . 'right';
             } else {
                 $wrapper = NULL;
             }
             // Only the primary sidebar is displayed
         } else {
             $main = $ss_framework->column_classes(array('medium' => 8), 'string');
             $primary = $ss_framework->column_classes(array('medium' => 4), 'string');
         }
     } else {
         // Only the secondary sidebar is displayed
         if (stachestack_display_secondary_sidebar()) {
             $main = $ss_framework->column_classes(array('medium' => 8), 'string');
             $secondary = $ss_framework->column_classes(array('medium' => 4), 'string');
         } else {
             // No sidebars displayed
             $main = $ss_framework->column_classes(array('medium' => 12), 'string');
         }
     }
     // Add floats where needed.
     if (is_page_template('template-2.php') || is_page_template('template-3.php')) {
         $main .= ' pull-right';
     }
     if ($target == 'primary') {
         $class = apply_filters('stachestack_section_class_primary', $primary);
     } elseif ($target == 'secondary') {
         $class = apply_filters('stachestack_section_class_secondary', $secondary);
     } elseif ($target == 'wrapper') {
         $class = apply_filters('stachestack_section_class_wrapper', $wrapper);
     } else {
         $class = apply_filters('stachestack_section_class_main', $main);
     }
     if (is_array($class)) {
         $class = implode(' ', $class);
     }
     // echo or return the result.
     if ($echo) {
         echo $class;
     } else {
         return $class;
     }
 }
예제 #2
0
        include stachestack_sidebar_path();
    } else {
        do_action('stachestack_sidebar_override');
    }
    ?>
					</aside><!-- /.sidebar -->
				<?php 
}
?>

				<?php 
do_action('stachestack_post_main');
?>

				<?php 
if (stachestack_display_secondary_sidebar()) {
    ?>
					<aside id="sidebar-secondary" class="sidebar secondary <?php 
    stachestack_section_class('secondary', true);
    ?>
" role="complementary">
						<?php 
    dynamic_sidebar('sidebar-secondary');
    ?>
					</aside><!-- /.sidebar -->
				<?php 
}
?>
				<?php 
echo $ss_framework->clearfix();
?>
 /**
  * Modify the rules for showing up or hiding the secondary sidebar
  */
 function control_secondary_sidebar_display()
 {
     global $ss_settings;
     $layout_sidebar_on_front = $ss_settings['layout_sidebar_on_front'];
     if (self::get_layout() < 3) {
         add_filter('stachestack_display_secondary_sidebar', '__return_false');
     }
     if (!is_front_page() && stachestack_display_secondary_sidebar() || is_front_page() && $layout_sidebar_on_front == 1 && self::get_layout() >= 3) {
         add_filter('stachestack_display_secondary_sidebar', '__return_true');
     }
 }