Example #1
0
/**
* Displays the secondary 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_secondary()
{
    global $hybrid_settings;
    if ($hybrid_settings['secondary_inserts_default'] && is_sidebar_active(__('Secondary Home', 'hybrid')) && !is_page_template('no-widgets.php') || is_sidebar_active(hybrid_secondary_var()) && !is_page_template('no-widgets.php')) {
        ?>

		<div id="secondary">
		<?php 
        hybrid_before_secondary();
        // Before secondary hook
        if (dynamic_sidebar(hybrid_secondary_var())) {
        } else {
            if ($hybrid_settings['secondary_inserts_default']) {
                if (dynamic_sidebar(__('Secondary Home', 'hybrid'))) {
                }
            }
        }
        hybrid_after_secondary();
        // After secondary hook
        ?>
		</div>

	<?php 
    }
}
<?php
/**
 * Secondary Sidebar Template
 *
 * The Secondary sidebar template houses the HTML used for the 'Secondary' 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( 'secondary' ) ) : ?>

	<div id="secondary" class="sidebar aside">

		<?php hybrid_before_secondary(); // Before Secondary hook ?>

		<?php dynamic_sidebar( 'secondary' ); ?>

		<?php hybrid_after_secondary(); // After Secondary hook ?>

	</div><!-- #secondary .aside -->

<?php endif; ?>