We've added one widget area to the sidebar, now we're going to add two to the footer.
footer.php
file.<aside>
element):<h3>Socialize</h3> <ul class="grid4up"> <li><a href="#" class="soc facebook">facebook</a></li> <li><a href="#" class="soc twitter">twitter</a></li> <li><a href="#" class="soc rss">rss</a></li> <li><a href="#" class="soc google">gmail</a></li> </ul> <div class="push"></div> <h3>About us</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>
<?php if ( is_active_sidebar( 'footer-left-widget-area' ) ) : ?> <?php dynamic_sidebar( 'footer-left-widget-area' ); ?> <?php endif; ?>
<aside>
element, you don't need to save this):<h3>Navigate</h3> <ul> <li><a href="#" target="" title="">title to link01</a> </li> <li><a href="#" target="" title="">another link02</a></li> <li><a href="#" target="" title="">a different title: link03</a></li> <li><a href="#" target="" title="">yet another link04</a></li> </ul>
<?php if ( is_active_sidebar( 'footer-right-widget-area' ) ) : ?> <?php dynamic_sidebar( 'footer-right-widget-area' ); ?> <?php endif; ?>
footer.php
file.We added two footer areas to our footer. The code works in exactly the same way as the code we used for the sidebar widget area.
If you check your site now you'll see that nothing is displayed in the footer, in fact the footer has completely disappeared. That will soon change when we add some widgets.
If you wanted to, you could register more widget areas for use elsewhere in the theme, for example:
Widgets are fun! They let you add all sorts of custom content to your site without having to touch a line of code. If you're going to have people who can't code working on your site, they're a great way for them to add extra content to the site, and they're even better if you're going to release your theme to other WordPress users—people who don't understand PHP can add custom content in your widget areas using the preinstalled widgets and by adding to these by using plugins.
The possibilities from using widgets and plugins are huge!
Setting up widgets is something you've probably done before and it's very easy to do. Let's add some widgets to replicate the static code we had in our mockup before we turned it into a WordPress theme.
The mockup included one widget area in the sidebar and two in the footer. The sidebar widget area contained three widgets, listing different kinds of content. So which widgets will do that job for us?
Great! That means we don't have to install any plugins, and can use the widgets already at our disposal to display all the content and links we need.
Setting each of these up is pretty straightforward, so we won't go into too much detail here, but let's just look at the steps involved.