Ejemplo n.º 1
0
 function shoestrap_section_class($target, $echo = false)
 {
     global $redux, $ss_framework;
     // Disable the wrapper by default
     $wrapper = NULL;
     if (shoestrap_display_primary_sidebar()) {
         // Both sidebars are displayed
         if (shoestrap_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 (shoestrap_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('shoestrap_section_class_primary', $primary);
     } elseif ($target == 'secondary') {
         $class = apply_filters('shoestrap_section_class_secondary', $secondary);
     } elseif ($target == 'wrapper') {
         $class = apply_filters('shoestrap_section_class_wrapper', $wrapper);
     } else {
         $class = apply_filters('shoestrap_section_class_main', $main);
     }
     if (is_array($class)) {
         $class = implode(' ', $class);
     }
     // echo or return the result.
     if ($echo) {
         echo $class;
     } else {
         return $class;
     }
 }
 public static function section_class_ext($target, $echo = false)
 {
     global $redux, $ss_framework;
     global $ss_settings;
     $layout = self::get_layout();
     $first = intval($ss_settings['layout_primary_width']);
     $second = intval($ss_settings['layout_secondary_width']);
     // disable responsiveness if layout is set to non-responsive
     $width = $ss_settings['site_style'] == 'static' ? 'mobile' : 'tablet';
     // Set some defaults so that we can change them depending on the selected template
     $main = 12;
     $primary = NULL;
     $secondary = NULL;
     $wrapper = 12;
     if (shoestrap_display_primary_sidebar() && shoestrap_display_secondary_sidebar()) {
         if ($layout == 5) {
             $main = 12 - floor(12 * $first / (12 - $second));
             $primary = floor(12 * $first / (12 - $second));
             $secondary = $second;
             $wrapper = 12 - $second;
         } elseif ($layout >= 3) {
             $main = 12 - $first - $second;
             $primary = $first;
             $secondary = $second;
         } elseif ($layout >= 1) {
             $main = 12 - $first;
             $primary = $first;
             $secondary = $second;
         }
     } elseif (shoestrap_display_primary_sidebar() && !shoestrap_display_secondary_sidebar()) {
         if ($layout >= 1) {
             $main = 12 - $first;
             $primary = $first;
         }
     } elseif (!shoestrap_display_primary_sidebar() && shoestrap_display_secondary_sidebar()) {
         if ($layout >= 3) {
             $main = 12 - $second;
             $secondary = $second;
         }
     }
     if ($target == 'primary') {
         $class = $ss_framework->column_classes(array($width => $primary), 'strimg');
     } elseif ($target == 'secondary') {
         $class = $ss_framework->column_classes(array($width => $secondary), 'strimg');
     } elseif ($target == 'wrapper') {
         $class = $ss_framework->column_classes(array($width => $wrapper), 'strimg');
     } else {
         $class = $ss_framework->column_classes(array($width => $main), 'strimg');
     }
     if ($echo) {
         echo $class;
     } else {
         return $class;
     }
 }
Ejemplo n.º 3
0
if (is_home()) {
    echo 'id="home-blog"';
}
?>
 role="main">
					<?php 
include shoestrap_template_path();
?>
				</main><!-- /.main -->

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

				<?php 
if (shoestrap_display_primary_sidebar() && is_active_sidebar('sidebar-primary')) {
    ?>
					<aside id="sidebar-primary" class="sidebar <?php 
    shoestrap_section_class('primary', true);
    ?>
" role="complementary">
						<?php 
    if (!has_action('shoestrap_sidebar_override')) {
        include shoestrap_sidebar_path();
    } else {
        do_action('shoestrap_sidebar_override');
    }
    ?>
					</aside><!-- /.sidebar -->
				<?php 
}