In this video, learn how to add a widgetized area to the footer.
(upbeat music) … - [Instructor] I hope you gave this challenge a try, … because conditionally hiding content … is pretty common in child themes. … If we scroll down, … you can see that I have my widget area here. … And if I go to a single post, … you can see there's no widget area. … So let me go to the functions.php file, … and I'll show you how I did it. … The first thing we had to do, … is we had to disable the line … that we added in our original functions file. … So that's remove action widgets init. … So I disable this. … Then I opened up footer-widgets … in my parent theme … and I copied it to my child theme. … There's a line right here, … is_active_sidebar, … and it was originally like this, … is_active_sidebar, … and I added these two conditionals: … If there's an active sidebar, … and it's not a single post, … and it's not a page, … then print all of this information. … That is all that you had to do. … One line, and it works. … We can, however, optimize this code … just a little bit more. …
- Setting up your development environment and editor
- Picking a parent theme
- Creating a child theme
- Including style sheets
- Creating and modifying styles
- Modifying functions
- Hooking functions
- Creating and modifying template files
- Adding menus and functionality
- Migrating theme files to a live WordPress site
Skill Level Intermediate
Using the exercise files1m 13s
1. Building on a Solid Foundation
2. Creating a Child Theme
3. Child Themes and CSS
4. Working with Function Files
5. Working with Template Files
6. Add New Functionality
7. Wrapping Up
Next steps1m 4s
- Mark as unwatched
- Mark all as unwatched
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.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.