/** * Displays the primary widget area * Check if the widget area is active or if the default is set to home * If neither is true, don't display the XHTML * * @since 0.2.2 */ function hybrid_get_primary() { global $hybrid_settings; if ($hybrid_settings['primary_inserts_default'] && is_sidebar_active(__('Primary Home', 'hybrid')) && !is_page_template('no-widgets.php') || is_sidebar_active(hybrid_primary_var()) && !is_page_template('no-widgets.php')) { ?> <div id="primary"> <?php hybrid_before_primary(); // Before primary hook if (dynamic_sidebar(hybrid_primary_var())) { } else { if ($hybrid_settings['primary_inserts_default']) { if (dynamic_sidebar(__('Primary Home', 'hybrid'))) { } } } hybrid_after_primary(); // After primary hook ?> </div> <?php } }
<?php /** * Primary Sidebar Template * * The Primary sidebar template houses the HTML used for the 'Primary' sidebar. * It will first check if the sidebar is active before displaying anything. * @link http://themehybrid.com/themes/hybrid/widget-areas * * @package Hybrid * @subpackage Template */ if ( is_active_sidebar( 'primary' ) ) : ?> <div id="primary" class="sidebar aside"> <?php hybrid_before_primary(); // Before Primary hook ?> <?php dynamic_sidebar( 'primary' ); ?> <?php hybrid_after_primary(); // After Primary hook ?> </div><!-- #primary .aside --> <?php endif; ?>