Using Widget Area Ready in Basics

Basics comes with 11 Widgets Area Ready. Some are triggered when you click and slide some Widgets from the Widgets settings, the others contains already default content until you click and slide Widgets to fit your needs. Look at the code nested within the sidebar-1.php file:

Widget Area hidden by default

<?php if ( is_active_sidebar( 'war-5' ) ) : ?>
    <section id="widget-area-5" class="widget">
        <h1 class="section-title"><?php _e('Section widget area 5', 'basics' ); ?></h1>
        <?php dynamic_sidebar( 'war-5' ); ?>
    </section> <!-- eo #widget-area-5 .widget -->
<?php endif; ?>

The section element is completely wrapped within a “if” condition. If the active sidebar is “on” (ie you’ve clicked and slided some Widgets from your WordPress settings) the section appear suddenly.

Widget Area with default content

    <?php if ( ! dynamic_sidebar( 'war-6' ) ) : ?>
        <div id="meta">
            <h2><?php _e( 'Meta', 'basics' ); ?></h2>
                <?php wp_register(); ?>
                <li><?php wp_loginout(); ?></li>
                <?php wp_meta(); ?>
    <?php endif; ?>

In this case, you can see a kind of contrary: despite no Widgets were clicked and slided, some default content fills the Widget Area. Feel free to use some other functions instead!

(We Salute You)