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

WordPress WordPress Theme Development Finishing Your WordPress Theme Adding Widget Areas to a WordPress Theme

Greg Schudel
Greg Schudel
4,090 Points

Not sure why the code works as it does.......::widget madness::

I'm following along and not hard coding my own project but I am a little lost with how this code creates a blog listing, archives and a search bar from the code:

CODE IN THE sidebar.php

<?php  if (!dynamic_sidebar('page') ): ?>
    <h2 class="module-heading">Sidebar Setup </h2>
    <p>Please drag and drop widgets from the WP Dashboard</p>
<?php endif; ?>

I just don't understand how putting this code makes the archive and search nav "magically" appear in the widget center. I'm sure it's something simple I'm missing. I've watched the video like 3 times and I'm still stumped. Can anyone explain what I am missing.

1 Answer

Greg Schudel
Greg Schudel
4,090 Points

I just saw the answer at 2:38 in the video. I'm pausing too frequently when reviewing these videos and not peicing the process we are doing together enough.