Watch every course in the library with a membership.
Each course includes high-quality videos taught by expert instructors.

Start Your Free Trial Now

Add a widgetized area to the footer in Wordpress Themes

Adding a widgetized area to the footer provides you with in-depth training on Web. Taught by Morten … Show More

WordPress: Building Themes from Scratch Using Underscores (2014)

with Morten Rand-Hendriksen

Video: Add a widgetized area to the footer in Wordpress Themes

Adding a widgetized area to the footer provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress: Building Themes from Scratch Using Underscores (2014)
Expand all | Collapse all
  1. 10m 55s
    1. Welcome
      1m 4s
    2. What to know before you start this course
      2m 40s
    3. How this course and the lesson files work
      3m 12s
    4. Introducing Simone: A preview of the final project
      3m 59s
  2. 21m 28s
    1. Installing and running WordPress on your computer
      3m 53s
    2. Getting and installing Underscores
      4m 11s
    3. Installing WordPress Theme Unit Test data
      4m 18s
    4. Installing the Developer plugin
      2m 58s
    5. Installing and setting up NetBeans or another IDE
      6m 8s
  3. 16m 15s
    1. Designing for mobile, content, and style
      4m 52s
    2. How do WordPress themes work?
      4m 48s
    3. Understanding the WordPress template hierarchy
      2m 19s
    4. Underscores: An overview
      4m 16s
  4. 37m 5s
    1. Setting up style.css
      4m 47s
    2. Configuring baseline settings and functions
      6m 6s
    3. Enabling custom fonts and font icons
      5m 44s
    4. Applying global styles
      5m 11s
    5. Styling basic layout components
      6m 19s
    6. Making the site layout responsive
      8m 58s
  5. 23m 18s
    1. Styling the default header
      6m 25s
    2. Hiding the site title and tagline
      5m 32s
    3. Adding an optional header image function
      5m 23s
    4. Placing the header image behind the site title
      5m 58s
  6. 40m 55s
    1. Setting up menus
      3m 12s
    2. Styling the menu
      7m 42s
    3. Using Superfish for accessible menus
      8m 0s
    4. Making the menu responsive
      7m 3s
    5. Creating a custom social media menu
      5m 51s
    6. Styling the menu with icons from Font Awesome
      9m 7s
  7. 18m 9s
    1. Adding the search form
      6m 27s
    2. Adding the search icon
      6m 55s
    3. Adding show/hide functionality to the search form with jQuery
      4m 47s
  8. 33m 20s
    1. Adding a widgetized area to the footer
      7m 10s
    2. Using the Monster widget plugin to test all widgets
      2m 11s
    3. Styling the footer
      3m 6s
    4. General widget styling
      5m 33s
    5. Adding custom styles to specific widgets
      7m 34s
    6. Using Masonry to make footer widgets responsive
      7m 46s
  9. 54m 49s
    1. Changing the Single Post Template content structure
      5m 54s
    2. Changing the output of meta elements
      7m 2s
    3. Styling the Single Post Template
      7m 57s
    4. Making post meta responsive
      6m 21s
    5. Styling blockquotes
      5m 39s
    6. Creating pull quotes and pull images
      5m 1s
    7. Working with image captions
      4m 27s
    8. Working with image galleries
      4m 57s
    9. Single-post navigation
      7m 31s
  10. 30m 23s
    1. Working with the comments template
      8m 42s
    2. Using Gravatars in comments
      2m 42s
    3. Styling comments
      7m 26s
    4. Highlighting post author comments
      3m 36s
    5. Styling the comment form and messages
      7m 57s
  11. 18m 43s
    1. How do featured images (post thumbnails) work?
      2m 57s
    2. Defining featured image sizes
      3m 30s
    3. Generating new featured images with a plugin
      1m 46s
    4. Adding featured images to a template
      5m 7s
    5. Styling the featured image
      5m 23s
  12. 1h 2m
    1. The index template hierarchy
      2m 21s
    2. Customizing and styling index templates
      10m 10s
    3. Displaying excerpts or full content on index pages
      3m 6s
    4. Adding a custom Read More link
      3m 48s
    5. Adding featured images
      4m 0s
    6. Creating custom pagination navigation
      6m 4s
    7. Highlighting Sticky Posts
      2m 55s
    8. Creating custom post format templates
      5m 30s
    9. Highlighting the most recent post in the index template
      7m 22s
    10. Embracing modular design
      2m 29s
    11. Working with archive.php
      5m 54s
    12. Customizing the search results and the 404 template
      8m 28s
  13. 9m 7s
    1. Styling pages
      3m 4s
    2. Creating custom page templates
      6m 3s
  14. 4m 30s
    1. Adding editor styles to match front-end styles
      4m 30s
  15. 2m 20s
    1. Further learning
      2m 20s

please wait ...
Adding a widgetized area to the footer
Video duration: 7m 10s 6h 23m Advanced


Adding a widgetized area to the footer provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress: Building Themes from Scratch Using Underscores (2014)

WordPress underscores

Adding a widgetized area to the footer

One of the staples of WordPress is the sidebars and other widgetized areas. These areas on the site allows the owner to add custom widgets, the little display functions like what you see on the right-hand side here to display additional content. Traditionally, these widgets were always placed in the Sidebar, and the WordPress terminology still uses the term Sidebar for these areas, but today you're just as likely to find widgetized areas in the footer or elsewhere on the page. And in this movie, I'm going to show you how to add a widgetized area to the footer.

Widgets and widgetized areas allow for a high level of customization and knowing how to add them to a theme will allow you to create custom widgetized areas anywhere on the site. Out of the box underscores has one widgetized area in the right-hand sidebar and this widgetized area has some default widgets that display if you don't configure any other ones from within WordPress, including search, recent post, recent comments, and so on. The widgetized area itself is created in functions.php.

If I scroll down here, you'll find a function called Register Sidebar, and this is where I said widgetized areas are called sidebars by WordPress, but they don't have to live in the sidebar. So here you see the area sidebar has been defined. It has the ID sidebar-1, and each of the widgets have, are wrapped in a side, and each widget title has a aged one with a class widget title. Once the widgetized area is defined, it's placed in the template file called sidebar.php, and this template file starts out with a conditional statement that says, if we don't have a dynamic sidebar, so the widgetized area, add a targetssidebar-one, then show these default widgets.

If, on the other hand, the sidebar, one dynamic sidebar exists, then this function here actually outputs the sidebar. So you don't have to do the operation twice. So this conditional statement is a very shorthand version of displaying the sidebar itself. The sidebar.php template is in turn called from our main templates, so, for example, if I go to index.php and scroll to the bottom, you'll see we have a function called get_sidebar, and this function automatically calls the file sidebar.php.

Now you can create additional sidebar template files, and if you want to call them, you would simply go in here and say something like get_sidebar footer. And now this function, we'll call a file called sidebar-footer, which is what we're going to create now. To create a new widgized area, we have to go back into function.php and register a new sidebar. So here I'm going to copy out register_sidebar as it is, and then just add another instance below, and then I'm going to give it a new name, so I'll give this the name, footer widgets.

I'll set the ID to sidebar two. You can set it to whatever you like. You just have to remember what it is. I'm going to set the ID to sidebar two. I'm also going to add a description here, so I'll add a new line, say description, and then I'll put the same markup, and I'm going to leave the rest of the markup as it is because that way all the widgets on my entire side will be marked up the same way. Now that I've created my new widgitized area, I can go to the back end of WordPress and go to Widgets.

And here you'll see now I have the sidebar, and I also have the footer widgets area with the footer widgets area description. And now I can drag and drop some widgets into that area so that I can test it. And I'm going to go to my front page and then jump to a post, so I don't have to scroll so much up and down. Now, of course, just adding the widgetized area does nothing. I don't have anything in the bottom of my page, so now I need to add the actual widgetized area into my footer. What I'm going to do here is create a new sidebar file, so I'll go to my theme and go to New and PHP file and call this one sidebar footer, and this is going to be the template for the widgetized area in the footer.

Here I have to put in the markup to call in the widgetized area I just created. And if you go to the cold snippets for this movie you'll see here I have all the mark ups. So I'm going to copy it out and paste it in, and here I'm using a different type of conditional statement to test whether or not my current sidebar is active. So in sidebar.php, you'll remember we had a conditional statement that says if bang, dynamic sidebar, sidebar-1. So what this statement does is it automatically outputs the sidebar if the user has configured widgets inside WordPress, but for the footer widgets, I want all the markup that wraps around the sidebar to only display if someone has actually added in widgets in WordPress.

So therefore, instead of saying if dynamic sidebar, I'm saying if not is active sidebar so that just tests whether or not there are widgets in the sidebar currently. And if this is set to true, we automatically run the return function, which means that this template file just terminates and goes back to whatever it was called, so we don't actually run the rest of this code. The rest of this code is fairly basic. Here, we have a divider with a ID supplementary that wraps around another divider with ID footer widgets and within that, we call the dynamic sidebar with the ID sidebar two, which is what we created.

So basically, what happens here is if you add widgets to the footer sidebar, this code will display. Now I can save sidebar footer and then I have to call this template file into the footer. So then I can go to footer.php and here I can place the footer wherever I want, so I'm going to just go to, right after content here, and here I can place my footer wherever I want. So I'm going to go into the footer and then just type in a PHP delimiter. And say, get_sidebar('footer');, and this function will now call my file sidebar footer.

And if we have widgets in the footer sidebar, all this code will display. So now I can go back to my page, reload it, and if we scroll down, you see, now we have those three widgets I attached. Recent posts. The calendar and categories in my footer. And if I go back to widgets, and go to photo widgets and just pull them out again, and reload the front page, and go to post and scroll down, the widgetized area disappears. What you should take away from what you've seen is this.

Using the file name structure sidebar-something, you can create as many sidebars as you want and call them from anywhere. The same goes for header-something and footer-something as well. So now you know how to add a widgetized area into your theme. Next we're going to style all our widgets so that they look nice.

There are currently no FAQs about WordPress: Building Themes from Scratch Using Underscores (2014).






Don't show this message again
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.

Mark all as unwatched Cancel


You have completed WordPress: Building Themes from Scratch Using Underscores (2014).

Return to your organization's learning portal to continue training, or close this page.


Upgrade to View Courses Offline


With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Course retiring soon

WordPress: Building Themes from Scratch Using Underscores (2014) will be retired from the library on February 15, 2016. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion. For updated training, check out WordPress: Building Themes from Scratch Using Underscores in the Online Training Library.

Become a Member and Create Custom Playlists

Join today and get unlimited access to the entire library of online learning video courses—and create as many playlists as you like.

Get started

Already a member?

Log in

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

You started this assessment previously and didn’t complete it.

You can pick up where you left off, or start over.

Resume Start over

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from

Sign up and receive emails about and our online training library:

Here’s our privacy policy with more details about how we handle your information.

submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.