You’ve created an amazing theme and now you want to share it with the rest of the WordPress community. In this lesson, we’ll walk through the best practices to follow when preparing your theme for distribution.
How Do I License My Theme?
WordPress is released under the GNU’s General Public License (GPL). The GPL is an open source license that allows any user to modify or redistribute the source code and all derivative works when such works are distributed, in order to make sure that the software — in the words of the Preamble to the license — “remains free for all its users”.
The “derivative works” category includes themes. This means that every WordPress theme you distribute (whether free or premium) must also carry the GPL license. Under the GPL, any user who downloads or purchases your theme is free to modify and distribute any part of it as they wish, without restriction. Full compliance with the GPL is required for all themes listed in the Free or Commercial Themes Directories on WordPress.org.
Here’s a great post with more information on how the GPL applies to WordPress Themes.
Does your theme include bundled fonts and third-party graphics and scripts? You’ll need to check that these assets use a license that is compatible with the GPL. The Theme Review Guidelines has a helpful list of GPL-compatible licenses for bundled resources.
Where Do I “Put” My Theme?
If you plan to distribute your theme for free, then it’s highly recommended that you submit it to the WordPress.org Free Themes Directory. There are two main advantages of adding your theme to the Free Themes Directory: a review from a real, live human on the Theme Review Team; and 2) the ability to reach the widest audience possible. Let’s elaborate a bit on these points.
100% Human Review
When you submit your theme to the WordPress.org Free Themes Directory, it’ll receive a thorough review from a member of the WordPress Theme Review Team. The Theme Review Team consists of dedicated WordPress community members who volunteer their time to review each submitted theme to ensure that the code meets the current guidelines. The Theme Review Guidelines were established to help improve the overall quality of themes in the Free Themes Directory, and to set general standards and best practices for theme development.
The length of the review process takes depends on how many themes are currently in the review queue, and how many issues the reviewer finds with your theme. If your theme does not pass the initial review, you’ll have the opportunity to make the necessary fixes and resubmit your theme for a second round, or a third, until it passes. It’s important to not get discouraged if your theme has to go through several rounds of reviews, just keep making fixes and resubmitting (and learning best practices), and eventually you’ll hit the mark!
Once your theme is added to the Free Themes Directory, it’ll show up in search results both on the Directory’s front page as well as in users’ Dashboards when searching for themes under Appearance → Themes.
So, it’s pretty obvious by now that adding your theme to the Free Themes Directory is one of the best ways to make your work readily available to other people!
If you plan to sell your theme, you’ll likely do so through your own website or through another premium theme marketplace. Even though your theme won’t be subject to review by the Theme Review Team, it’s a good idea to adhere to the Theme Review Guidelines and to follow best practices as much as possible. This way, you’ll ensure that the product you’re selling to your customers is safe, up-to-date, and high-quality.
The WordPress.org Commercial Themes Directory is a great way to promote your commercial themes.
How Do I Prepare My Theme For Distribution?
When you build a theme for the wider community, you must take care to make your theme as adaptable as possible. For example, some users might only add one item to their menu, while others might add ten. Some users might write multi-line titles for their posts or widgets. These are just a few scenarios. Your theme must be able to adapt as much as possible to ensure that it remains usable by a wide audience.
It’s impossible to predict and prepare for every single use case, but here are a few common things to think about when developing:
- Make sure your theme can endure a wide range of content situations without breaking — long post titles, long widget titles, many menu items, etc.
- Make sure your theme is translation-ready.
- Add a right-to-left (RTL) stylesheet for those whose languages read from right-to-left.
- Make sure the fonts you use support characters from a wide number of languages.
- Avoid hard coding, and respect user settings as much as possible.
- Avoid using ornamental graphics (such as a post title or widget title background) that break if text gets too long or too short. In fact, use CSS3 effects in favor of ornamental graphics wherever possible. These days, you can create rounded corners, drop-shadows, gradients, and more with CSS3.
This is is not exhaustive, but it’s enough to get you started. If you develop in accordance with The Theme Review Guidelines, test with the Theme Unit Test, and run the Theme Check Plugin, you’ll be well on your way to making sure your theme is fit for the masses!
Ongoing Maintenance and Support
It’s recommended that your theme have a “home” on the web. Whether this is a section of your personal site, or a site you set up just for your theme, it’s a useful resource for your users. You can provide documentation, a link to a demo, the latest news and theme updates, and of course, information telling users where they can get support. Some theme authors choose to offer support on the WordPress.org Themes & Templates support forum, and others offer support on their own website.
The Theme Review Team reviews all updated versions of themes already in the Free Themes Directory to ensure that the themes continue to meet the guidelines, and any that were added since the first review.
With that, you’re now ready to jump into the wild world of WordPress Themes. I hope you’ve enjoyed this tutorial and have learned something. If you have any suggestions on how we can make it better, please leave a comment!
How To Create a WordPress Theme
This post concludes the The ThemeShaper WordPress Theme Tutorial: 2nd Edition that will show you how to create a powerful WordPress Theme from scratch. Read it from the beginning and code yourself up something awesome.
- WordPress Theme Tutorial Introduction
- Developing Theme Sense
- Theme Development Tools
- Creating a Theme HTML Structure
- Template and Directory Structure
- Setting Up Your Theme Functions
- Secure Your WordPress Theme
- The Header Template
- The Index Template
- The Single Post, Post Attachment, & 404 Templates
- The Comments Template
- The Search Template & The Page Template
- The Archive Template
- The Sidebar Template & The Footer Template
- Reset-Rebuild Theme CSS & Define Your Layouts
- Custom Background & Custom Header
- Distributing Your WordPress Theme