To make our widgets work in the sidebar, we'll need to replace some of the existing code with a WordPress tag to display the correct widget area.
sidebar.php
file.<aside class="sidebar right third"> <?php if ( is_active_sidebar( 'sidebar-widget-area' ) ) : ?> <div class="bdr grd-vt-main rnd shdw-centered"> <?php dynamic_sidebar( 'sidebar-widget-area' ); ?> </div> <?php endif; ?> </aside>
sidebar.php
file.We added a widget area to our sidebar. Let's have a look at the code in detail:
<aside>
element to contain our sidebar—which is the same as in our static mockupsidebar-widget-area
dynamic_sidebar
tag with the ID of our sidebarNow let's see what the site looks like in the browser:
At the moment the sidebar is empty because we haven't added any widgets. We'll do that in a moment but first let's add widget areas to our footer.