Introduction to Child Themes in WordPress

I gave a presentation on child themes in WordPress tonight at the SoCal WordPress meetup, and it seemed to go well. Except for one thing: I left Screenflow in pause the whole time.

sad trombone

I promised to record this presentation, and I'm not going to let my incompetence get in the way of a promise. So here it is, re-recorded at home.

This is not up to the same production standards as my other training videos (there are no edits except trimming the beginning and end, and no help from the venerable video2brain), and there is none of the good Q&A that followed the original presentation, but it should still serve as a good introduction to child theming in WordPress, whether you were at the meetup or not. You also have the bonus of me speaking into a nice microphone. Ooooooo! The slides are here.

In my WordPress theming course, I go over this subject and a whole lot more, so if you think I'm not the worst teacher ever, I encourage you to go check that out as well. That course is available, and at a 20% discount for a limited time.

Here are some links to more information about subjects that appear in this video, as well as some of the things I remember from the Q&A:

  • 1Password is the password manager I use. It's great.
  • MAMP is the *AMP stack I use to run WordPress (and Drupal, and other stuff) on my Mac. There are other options available like XAMPP or BitNami that are multi-platform too. I actually use the MAMP Pro version, since it makes managing virtual hosts (e.g. local.example.com) take 3 seconds instead of 10, and because I wanted to support the project.
    Hot tip: if you do local theming/development (and you should) and use a password manager (which you should), using hostnames like local.clientdomain.com will allow your passwords to be looked up even when you deploy your site to www.clientdomain.com. At least, it works that way in 1Password. This is as opposed to using clientdomain.test or whatever, which I used to do, and meant I had to edit my 1Password keychain when I went from local to the internet.
  • I use TextExpander to store the WordPress child theme CSS metadata comment format, as well as the one for plugins, and lots of other stuff. It's much easier than trying to just remember it, or looking it up in the Codex all the time.
  • We looked at web inspectors at the meetup, specifically Firebug. In the video, I used Safari's built-in Web Inspector, but they all have largely the same functionality, and all are worth learning to use.
  • I didn't talk about text editors in this recording, but I can't recommend highly enough that you use a good text editor. I like general purpose editors like TextWrangler, BBEdit, or Sublime Text because they support all the languages I need (i.e. not just CSS). Even if you like to use the built-in WordPress theme editor to make changes to stuff, I think it's worth copying text out of that, into the editor, making your changes in the editor with the nice colors and so forth, and then copying those changes back into the theme editor in your browser. You avoid losing work due to browser crashes, and you get things like syntax coloring, auto-complete, the ability to save your work with a keystroke and reduce the changes of losing anything. If you have Dreamweaver, that has a very good text editor (I think it's called a code editor) too.
  • I made several references to Jetpack's Custom CSS module, and nodded to Underscores as a theme that is a good starter for custom themes, but not to be used in child theming contexts.
  • The cascading part of CSS, and CSS specificity, came up several times tonight. There are lots of online resources to help learn this, including the actual CSS specification, but here's an article that's a bit shorter.
  • The version control system I use in most of my work is git, and I use Gitbox to manage my repositories. The WordPress project uses Subversion, so if you're getting started with the idea of version control, that would be fine too. I like git because it's decentralized, which means that I don't have to set up a central server or folder to store everything. I just initialize a project folder on my Mac, wherever it already resides, and I'm good to go. I think everyone who works on web stuff, even if you're not a programmer, should check out version control of some kind. This guide on git for designers illustrates some of the benefits. There have been times where I've thought using version control was a pain, but since I started using distributed systems like git (and Mercurial), and using Gitbox, I've found it to be pretty painless, and the wins are huge.

If you watch this video, write in and let me know what you think. If you were at the meetup, and I forgot something useful, remind me in a comment!

Categories: 
Tags: 

Comments

First Response ...

Hi there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I really enjoy reading through your articles. Can you suggest any other blogs/websites/forums that go over the same subjects? Appreciate it!

Comments are closed on this post to keep spammers at bay. If you want to chime in, please email or send a tweet.