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.

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.