First of all, I applaud you for seeking to level up.
The intent of themes is to provide the presentational HTML markup structure and the styling for a website. In order to develop quality, clean themes, an author needs to be versed in many different disciplines including: PHP, HTML, CSS, and WordPress core.
Remember that themes, like plugins and anything in software, is a matter of understanding the environment, languages, and technologies. There is little magic to writing a theme or plugin or anything really in code. It’s all dependent upon your programming abilities and creativity. You need to first understand the fundamentals and the Why of it.
Ok so where do you start?
Step 1: Assess Your Skills
Assess your skills and knowledge of the disciplines above. Where you have gaps, you want to stop and go fill those.
Step 2: HTML
You need to truly understand what comprises valid, well-structured, and semantically correct HTML structure. To me this is the most important aspect of theming.
Why? Because everything starts and ends with the HTML in the browser. While to a sighted person, you and I may not be that interested or notice what is under the prettiness of a website, to other pieces of software, that structure is critical.
Therefore, for me, a solid understanding of HTML, microdata, and the selection of the right tags for semantic and contextual meaning is a vital role of the theme author.
Step 3: PHP and WordPress
WordPress is built on PHP. You need a solid understanding of PHP and WordPress in order to write clean, quality code for themes and plugins.
Why is that important? You want to produce products in a timely manner and that require as little of your time as possible to support it. Without a solid understanding and that fundamental baseline, you may be inducing problems and buggies into your code. Those can be time consuming and irritating for site owners. You might also be taking the long way around to solve a problem, meaning that you have too much code. That’s problematic because then that’s more stuff for you to maintain.
Ask yourself if you understand the fundamentals, variables and scoping, memory movement, WordPress event-driven system, and more. Take an assessment of your skills and ability to translate that knowledge into actually building quality solutions.
Step 4: Clean, Quality Coding Techniques
Clean, quality code. I am an advocate of learning how to write clean, quality code and embracing software principles. It’s what I teach and do. Learning how to write in a DRY, modular, and readable fashion increases the quality of your code, decreases the bugs and issues, makes your code more maintainable (which means less $$ for service and support), and allows you to spin up solutions faster. Just doing those three principles will make your products so much better!
Some examples are:
These are just a few examples of how to write clean, quality code. Take the time to learn these principles and then roll it into your codebase.
Selecting the Right Source for Your Education
Select courses, programs, and tutorials from teachers who promote fundamentals, know how to break it down into bite-sized morsels, make it relatable, and help you to take a piece of knowledge and adapt it to fit your needs. I see so many programs out there which promote a “copy/paste” or “just do this” approach. The problem with this approach is: it fits one edge case and problem but is not adaptable for you to take it and make it your own in any situation.
Just be mindful of where you spend your valuable time in your continuous learning journey. We all have to do that. And remember that your time is very valuable as there is only so much time you have in a day. Use it wisely.
Styling -> CSS
I’d like to address pre-packaged solutions and the one-sized fits all approach. Bootstrap, Foundation, and others solve a particular problem in the market of giving a quick starting point. But they have a cost to them.
Bootstrap and Foundation, for example, drives the HTML attribute structure to their way to ensure it fits how they are targeting the styles. I like Foundation much better than Bootstrap.
Next, they are bloated as they come with a set of styling libraries to fit a variety of needs. You need to select only that which you need. Why make a device and its browser download the entire library when you are only using a portion of it? It slows down the web page loading and is unnecessary. I advocate that their stylesheets should be very lean and only contain the styles needed and used on the specific website.
In your quest to level up your theming, invest your time into learning Sass and CSS. Then build a starter theme with the modules that you need. Only load that theme’s needed styles and avoid the bloat.
I spend a lot of time in the CSS Reference that Sara put together. It helps me to really know what is possible as well as the proper usage of the CSS properties and attributes. For Sass, I think James Steinbach does an excellent job teaching the essence of Sass as well as the fundamentals. He is my go-to resource (plus I can just ask him in the WP Developers Club too).
Keep Themes Focused on Presentation
Listen to me. Themes have a specific intent. Keep the features and functionality out of the theme and put those into plugins where they belong. Here are some free videos which give you more on the subject:
Wrap it Up
Whew, seems every time I share, I write a book. LOL I want to leave you with this video that I did on Zac’s site: My Secrets to Leveling Up.
Be a More Awesome Developer
I’m writing a book on leveling up in WordPress development. It will provide you with a roadmap for “level up” habits and techniques as well as self-assessment tools you can use throughout your entire career. The habits will be setup for the various stages in your career. Check it out here on LeanPub.
Cheers and Happy coding!