Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Create a child theme based on an existing parent theme in WordPress and change the functionality, presentation, or styling of your website. In this course, author Morten Rand-Hendriksen shows how to use the default WordPress theme, Twenty Twelve, as a basis for a new child theme and add custom menus; new headers, sidebars, and footers; and index pages with widgets and pagination to your site. The course also demonstrates how to add a responsive welcome message to your front page using PHP and jQuery, and how to edit the many templates found in a WordPress theme. Morten explains how to perform these changes using any code editor, the developer tools in the Chrome browser, and WordPress.
Just like an artist usually signs her paintings and other works somewhere on the bottom to put her mark on them, so should you put your own information at the bottom of your new child theme so that others can see what you've done. When creating a child theme, I always encourage some coding courtesy. By that I mean you should always say that this is a child theme and reference the original. That way you're both giving props to the people who built the original theme and at the same time you're letting people compare the original to your new and improved child theme.
The logical place to put this information as well as some other information is down here in the footer. In addition to adding information about your child theme, I also like to add a copyright notice with the current year and a link back to this site. That's not strictly necessary, but it's a good idea to just remind people that when they see things online someone actually owns to copyright to that content. So let's start by adding the copyright notice. I'll go to my child theme, open footer.php, and find where I want to put this information.
I'm going to put it after this action call here, and I'll start with a copyright notice. I wanted to say Copyright and then I want to put in that copyright symbol, the circle with the C inside it and then I want to put in the year. Here I'm going to use a PHP function to call up the year. I'll say echo date, capitalized Y. This will print out the current year and then I want to put in a link to the current site. So I'll say a href= and then I'm going to use a WordPress function that will return the URL to the main site's homepage.
So I'll say php echo and the function is called home_url and because it's a link I need to give it a title. The title should be the name of the site, so here I'm going to use another function from WordPress, this one called bloginfo ('name') and this will simply print out the name of the site as you've said it inside WordPress. And then I'm going to copy this, end my tag and paste it in again because I wanted the actual text of the link to say the name of the site.
And then I will end my anchor tag and put a punctuation mark at the end. I'm going to save this and test it in my browser just to say that everything works, and now we can see it says Copyright with a copyright symbol, Twenty Twelve Red 30 Blog. That's great. Now I need to add the information about the parent theme and the child theme. Back in footer.php, I'll say Twenty Twelve child theme by Morten Rand-Hendriksen.
And then I want to wrap Twenty Twelve in an anchor so that people can go and check out Twenty Twelve, a href= and then I made the URL to Twenty Twelve and I have it up here, this points directly to Twenty Twelve in the themes directory. So I'll copy that URL, paste it in, title="Twenty Twelve" and I'll also set a target so that it opens in a separate window, blank and then I'll end my anchor on the other end of Twenty Twelve.
I will save it again, reload my site, and now you see it says Copyright 2012, Red 30 Blog, and here there is a link to Twenty Twelve that says Twenty Twelve child theme by Morten Rand-Hendriksen, Proudly powered by WordPress. If I click Twenty Twelve, opens a new window and here's Twenty Twelve. With a favicon, a screen shot, and a custom footer, your child theme is complete. Congratulations.
Find answers to the most frequently asked questions about WordPress 3: Building Child Themes.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.