Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP How to Build a WordPress Theme Extending WordPress Template Functionality How to Widgetize a Theme

Dan Barrett
Dan Barrett
10,450 Points

The available widgets do not appear to be showing within the new widget areas.

I have followed this video and can see the widget areas in the admin panel but when I pull in available widgets into the zones they do not appear on the front-end but still show the content which is hard coded in.

Here the code within functions.php

function create_widget( $name, $id, $description ) {

$args = array(
    'name'          => __( $name ),
    'id'            => $id,
    'description'   => $description,
    'before_widget' => '',
    'after_widget'  => '',
    'before_title'  => '<h5>',
    'after_title'   => '</h5>' 
    );

register_sidebar( $args );

}

create_widget( 'Left Footer', 'footer_left', 'Displays in the bottom left of footer' ); create_widget( 'Middle Footer','footer_middle', 'Displays in the middle of footer' ); create_widget( 'Right Footer', 'footer_right', 'Displays in the bottom right of footer' );

Here is footer.php

<footer>
    <div class="grid_12 omega clearfix">

        <div class="grid_4 footer-left">
            <?php if( dynamic_sidebar( 'footer-left' ) ): ?>
            <?php else: ?>

                <h5>Twitter</h5>
                <p>Install the TwiGet plugin and place the widget here in the left bottom footer</p>

            <?php endif; ?>
        </div>


        <div class="grid_4 footer-middle">
            <?php if( dynamic_sidebar( 'footer-middle' ) ): ?>
            <?php else: ?>

                <h5>dribbble</h5>
                <p>Install the dribbble plugin and place the widget here in the left bottom footer</p>

            <?php endif; ?>
        </div>

        <div class="grid_4 omega footer-right">
            <?php if( dynamic_sidebar( 'footer-right' ) ): ?>
            <?php else: ?>

                <h5>Treehouse</h5>
                <p>Install the treehouse plugin and place the widget here in the left bottom footer</p>

            <?php endif; ?>
        </div>


    </div>
    <div id="copyright">
                <p>&copy; Copyright <?php echo date('Y'); ?> - all rights reserved</p>
            <div class="grid_12 ss-icon omega">
                <a href="#">&#xF610;</a>
                <a href="#">&#xF611;</a>
                <a href="#">&#xF612;</a>
                <a href="#">&#xF613;</a>
                <a href="#">&#xF660;</a>
                <a href="#">&#x2709;</a>
            </div>
        </div>
</footer>

<?php wp_footer(); ?> </body> </html>