Making a theme for WordPress is easier than ever these days (in theory, an index.php file and a style.css file is all you need!). But if you plan to be the creator of a good theme, a perfect WordPress theme, you need to train hard.
In this series, we're going to go through the many aspects of creating a theme such that it will arguably the best theme you've ever created.
What Makes a Theme Great?
Seriously, what makes a theme great?
Good design? Yes, but I've seen many WordPress themes that almost made me cry because of their beauty. But when I bought and downloaded it, I saw that it lacked even the basic coding standards and it immediately broke my WordPress installation.
So, is code structure important? Sure, but I've stumbled upon very sophisticated code in WordPress themes - the beauty of object-oriented PHP, readable CSS, brilliantly documented code blocks, and so on. But it broke the minute I installed it on WordPress 3.6 - it seemed that it only worked up to version 3.2.
What about maintenance? Of course, but this one time, I had to buy a theme for my client that utilized the latest WordPress features for that version. It was a good theme, but I just couldn't move a block to another place - it didn't even let me avoid using it! The website had to be the same as the demo website or it would fall apart.
So, flexibility? Yeah, but...
You get the idea - there's not just one thing that makes a theme great.
Customer care, valid code, secure code, compatibility with major plugins, and it has to be distributed properly with respect to the licensed products it includes.
So Much to Learn...
Indeed, there's so much to learn.
We need to go through some of the APIs offered by WordPress first - maybe not all of them, but a theme developer must learn about the Options API, the Settings API, the Theme Customization API and so on. Then, we'll see the importance of localization, and have a look at licensing options for various marketplaces like ThemeForest, Creative Market, or your own website.
Next, we will learn to write better code. WordPress coding standards are important and the marketplaces are strict. Proper code commenting is also important for every bit of code we use. Validating the code is also crucial, as is its security.
After that, we're going to have a look at bad practices - worst practices, really. From reinventing the wheel (by duplicating core features) to having the most bloated theme ever (with five thousand fonts and tons of shortcodes!), we will see what not to do and avoid these.
Finally, we're going to grasp the importance of compatibility, maintenance and customer care. Supporting various plugins like bbPress or WooCommerce is a huge plus, but regularly updating your theme and providing excellent support are more than that. Way more.
This was the introduction, the warming-up for our series. Stay tuned for more: In the next set of articles, we'll be discussing the APIs, localization, licensing and more.
Also, don't hesitate to comment on this post with your suggestions. We have a solid outline for the series, but you can help shape it with your questions! :)
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.Update me weekly
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post