I’ll be honest. I haven’t been on the computer much over the last 4-5 days.
I’m in the process of selling my old house – a house I’ve owned for almost a full year after buying my new house – so I’ve been more than a little distracted.
Nevertheless, I have accomplished a little with my WordPress theme development efforts.
Here’s what I’ve learned so far.
Making the Perfect WordPress Theme
In the process of learning about plugin development and through osmosis, from working with WordPress developers for the past 4+ years, I knew the very basics of theme development going in.
I knew that at the very least, I needed and style.css file with a specific header comment block and an index.php file. I also knew about the functions.php file and probably a little more, but I wanted to understand the proper way to build a theme. So, I started by looking around for a tutorial on how to build a WordPress theme.
After not too long, I found Making the Perfect WordPress Theme tutorial. It doesn’t show how to write or organize any code, but it gives a nice introduction on how to think about WordPress theme development.
I also appreciated the explanation for why localization is so important and enjoyed the How to Code Well section of the tutorial.
Organization is Key
It seems I can’t go long without thinking about how to organize my code and this effort has been no exception.
After getting some of the theory under my belt, I began to look for models for how to organize my theme code and I found Ian Stewart’s Creating a WordPress Theme HTML Structure tutorial.
I’m pretty sure that is the tutorial I’m going to work through, but I haven’t yet.
Given I’ve been so distracted lately, I let myself get diverted to what I think is a lazier, though not incorrect, path and found a ready-made starter theme to work with.
A 1000-Hour Head Start
Enter Underscores: A starter theme created by those who know WordPress best, follows all the current best practices, and is regularly updated. How can you go wrong? Just read the A 1000-Hour Head Start: Introducing The _s Theme and tell me if you don’t agree.
BTW, “_s” is the the geeky-cool way to write “underscores.” Kinda like how “a11y” is the in-the-know way to write “accessibility” – a[11 letters]y = a11y.
If you want to try _s, I recommend downloading it from http://underscores.me/. From there, you can name your copy of the theme and forgo the tedious process of changing all references in the code from underscores or _s to the-name-of-your-theme.
I’m liking _s so far, but two things are bothering me.
I am suffering from buyers remorse
One of the selling points of _s is how it regularly gets updated with the latest best practices in WordPress theme development. Unfortunately, it doesn’t look like you can take advantage of those updates on existing projects and so I feel like I’ll miss out on all the new future features.
I’m probably showing my lack of understanding of Git here, but I don’t see how to pull the latest changes to my local copy after naming my copy of the theme and modifying the _s files.
It is clearly stated on every _s site I’ve seen that it isn’t a parent theme – it is a starter theme, so I know I’m not supposed to child theme it. I just wish there was a way I could easily pull in future updates and save future hours of work.
I believe in starting from scratch
I really do want to go back to that “Creating a WordPress Theme” tutorial and build a theme from scratch.
This urge probably comes from how I first learned to program – I wrote Turbo Pascal code on paper. Write a program on paper, then be the compiler and describe the output of your code to an instructor, and you learn it.
I’m not going to write my theme on paper, but I do want to go through the entire process and learn the fundamentals before taking full advantage of something like _s.
Consequently, I think I’m going to set _s to the side. Not for 1000 hours, but for a while.