/**
 * Shortcode to display a sidebar virtually anywhere.
 *
 * @since StartBox 2.5
 */
function sb_sidebar_shortcode($atts)
{
    extract(shortcode_atts(array('location' => 'shortcode', 'id' => null, 'classes' => null), $atts));
    if (is_null($id)) {
        return null;
    }
    ob_start();
    sb_do_sidebar($location, $id, $classes);
    return ob_get_clean();
}
示例#2
0
<?php

/**
 * sb_do_sidebar() is defined in /includes/functions/sidebars.php
 *
 * Default Output:
 * hook: sb_before_{$location}
 * <div id="$location" class="aside $location-aside">
 * 	hook: sb_before_{$location}_widgets
 * 	<ul class="xoxo">
 * 		sidebar contents, or hook: sb_no_{$location}_widgets
 * 	</ul>
 * 	hook: sb_after_{$location}_widgets
 * </div>
 * hook: sb_after_{$location}
 */
sb_do_sidebar('primary', 'primary_widget_area');
sb_do_sidebar('secondary', 'secondary_widget_area');
示例#3
0
function sb_home_featured_sidebar()
{
    sb_do_sidebar('featured_aside', 'home_featured', 'featured-aside');
}
$footer4 = is_sidebar_active('footer_widget_area_4') || has_action('sb_no_footer_aside_4_widgets');
if ($footer1 || $footer2 || $footer3 || $footer4) {
    $column = $column1 = $column2 = $column3 = $column4 = null;
    if ($footer1 && $footer3 && $footer3 && $footer4) {
        $column = 'column one_fourth';
        $column4 = ' last';
    } elseif ($footer1 && $footer2 && $footer3) {
        $column = 'column one_third';
        $column3 = ' last';
    } elseif ($footer1 && $footer2) {
        $column = 'column one_half';
        $column2 = ' last';
    } else {
        $column = 'column last';
    }
    ?>
	<div id="footer_sidebar">
		<?php 
    sb_do_sidebar('footer_widget_area_1', 'footer_widget_area_1', $column);
    sb_do_sidebar('footer_widget_area_2', 'footer_widget_area_2', $column . $column2);
    sb_do_sidebar('footer_widget_area_3', 'footer_widget_area_3', $column . $column3);
    sb_do_sidebar('footer_widget_area_4', 'footer_widget_area_4', $column . $column4);
    ?>
	</div><!-- #footer_sidebar -->
	
<?php 
}
?>

<?php 
sb_after_footer_widgets();