Getting Started with your perfect WordPress theme
Ready to start developing WordPress themes? You’re in the right place.
In this opening chapter, we’ll take a look at what WordPress themes are and how they work. Then, we’ll discuss the GPL, the software license used for WordPress and all of the themes in the WordPress theme directory.
Next, we’ll look at some of the tools you’ll need in your WordPress theme development toolkit and teach you how to setup a local development environment.
We’ll finish up this chapter by looking at a few solid WordPress theme examples.
We’ve seen it happen so often. You have a great blog, and at some point, you decide to go for a new look and feel. There are a couple of things you’ll look at, usually in the order: layout / look and feel, usability, and optionally, room for advertising. If the theme meets your needs in all two or three of these points, you might download and install it. If that sounds familiar, this post describes how to find the perfect WordPress theme!
A theme has quite a few things to take care of, and a lot of themes miss out on these. This overview should help to keep you out of trouble when you’re looking for a new theme. If you’re thinking of installing a new theme, please give the following points a thought. Keep in mind; your new theme should be accessible, compatible, customizable, integrable and standards compliant.
Define your needs
Whether you are in the market for a free theme, a premium theme or want to hire a developer to build one especially for you, the first step is always the same: define your needs. Write down what the theme should do, now and in the future. You might not need an eCommerce shop at this time, but what about in a year from now? What should your site look like? Which pages do you need? What types of content are you planning to publish? Once you have a clear picture of the requirements, you have a better chance of finding your dream theme.
Find a trusted reseller or developer. How’s the support?
Should you build a theme yourself? Or will a general free theme do? The discussion on whether a premium theme is better than a free theme continues to rage on. Both sides have their merits. There are loads of crappy free themes, but there are just as many crappy premium themes. What you should do is find a reseller or developer that you trust. Look for social proof; how many reviews does a theme get? Is there an active message board? When did it receive its last update?
In general, every theme on WordPress.org underwent scrutiny, so they are safe to use. But that doesn’t mean they’re awesome. Theme resellers offer loads of premium themes in varying degrees of awesomeness. But just because you pay for them, doesn’t necessarily make them better than free themes. In addition to that, since you only receive the files when you pay for a theme, there’s no way to check the quality upfront. Despite social proof, it’s still a leap in the dark.
How flexible is the theme?
A static theme won’t do you any good when you want to change the page layout in a couple of months. Make sure to choose a theme that is flexible in its appearance as well as its functionality. Don’t choose a design that screams for full-width images when you only need a well-presented place to write your poetry. Check what happens to a theme when you turn off all massive images; does it still function? And is it possible to change colors, fonts and other visual elements?
Your theme should have ample room for widgets, plus it should support featured images and offer multi-language support. Lots of themes have a page builder on board; these help you construct your bespoke layout. But, this is something you should be careful with because these could generate less than stellar code that hinders your SEO.
Which post and page templates does the theme support?
Another way to keep things flexible is for a theme to offer multiple posts and page templates. That way, you could start off using a basic template with a main content area and a left sidebar, but have the flexibility to change to a full-width content area or one of the many other options. If a theme has only two choices, that might become problematic in the future. Pick a theme with enough sensible templates.
Does it function as a parent/child theme?
Parent and child themes are a great combo. If you use any of the theme frameworks like heavy hitter Genesis, you know how powerful these are compared to regular themes. A child theme gets its functionality from a parent theme. So if you’re making changes to your child theme, the parent won’t see these. You won’t break the parent theme if you make a mistake. The same goes for updates; if you update your parent theme, which happens often, it won’t wipe the changes you’ve made to your theme because it’s a child and doesn’t contain the functionality.
Whether you need a theme framework depends on your needs. Almost all WordPress projects will benefit from a theme framework, but it might be overkill if you only need a tiny amount of its functionality and you know exactly what kind of theme you need.
Watch out for theme bloat
Many themes are bloated, and this will increase loading time. If the developer of a particular theme included everything but the kitchen sink, you might get a feature-complete product but an insanely complicated one as well. Try to find a theme that offers everything you need, instead of everything there is. Your theme should be lean and mean. See the next point.
Check site speed and mobile-readiness
In this day and age, mobile-friendliness is imperative. In addition to that, your site and its theme should load as fast as possible. Choosing a lean and mean theme will certainly help in this regard. Check the responsiveness of a theme and run a Google mobile-friendliness test. You could also enter the address of the theme’s demo site in Google’s PageSpeed tool to see if there are particular loading issues. However, this is just an indication, since you can only judge the real loading speed of your theme when it’s running on your server.
Is the theme’s SEO in order?
Is the theme’s code valid?
Many a theme author is more of a designer than a coder, and thus they sometimes hack around until it finally looks the way they want, without bothering to check whether the code they’ve written is valid HTML. If it’s not, current or future browsers might have issues rendering the content correctly. You can check whether the code is valid by using the W3C’s validator.
Test, test, and test again
Once you’ve chosen your favorite new theme, it’s time to kick it into gear. Start with a development setup to test your new theme through and through. Run every type of test you can think of. This might be a security check with the Sucuri plugin or a theme check with the Theme Check plugin. Load your site with dummy data from wptest.io to see if every element is represented and functioning. Run pagespeed and mobile-friendliness tests to see if problems arise. Fix the issues, or find a new theme.
That’s just to get you going. There’s a lot of stuff you can check before you install your brand-new theme. Start with these three checks, if you will:
WordPress plugins use so-called “hooks” to be able to perform their designated tasks. These hooks allow for instance to add extra output, tracking codes, etc. A lot of issues with plugins will arise for you when a theme author forgets to add these hooks. This is how to check for them:
1. In header.php, it should have a small piece of PHP code that looks exactly like this
wp_head(); or this
do_action('wp_head');, usually just before a piece of HTML that looks like this:
2. In footer.php, it should have another small piece of PHP like this
wp_footer();, or this
3. In comments.php and/or comments-popup.php, it should have a piece of code like this:
<?php do_action('comment_form', $post->ID); ?>, just before the
</form> HTML tag.
Another wise thing to do when you’re changing themes is to compare theme files. If for instance, your current theme has an author.php file, which contains the template for your author profiles, and your new one doesn’t have that, that might be an unpleasant surprise when you install the theme. The files you should be checking for in your old and new theme:
- home.php: the homepage template.
- single.php: the template for single posts.
- page.php: the template for pages.
- category.php: the template for category indexes.
- author.php: the author template, used when someone wants to find all posts by a certain author.
- date.php: the date template, used when someone tries to look at for instance a certain month of posts on your blog.
- archive.php: this template is used when either category.php, author.php or date.php isn’t there.
- search.php: used when someone searches on your blog, a very important template to look at if you’re concerned about usability, and whether people can find posts on your blog.
- 404.php: used when WordPress can’t find a certain post or page, this is a very important template file to have!
How is your theme handling titles?
You should check how your current theme is handling page titles in the file header.php. You can find it within the <title> HTML tags. If the title tag differs, you might want to check out why and what happens when you enable your new theme. Sometimes it’s for the better (for instance, because it turns around blog description and page / post title), but you have to make sure up front!
It will probably look something like this:
<title><?php bloginfo(‘name’); ?> <?php wp_title(); ?></title>
If it does, you’ll be a lot better to change it to:
<title> <?php wp_title(); ?></title>
If your theme does all of this correctly, you should be quite ok. Good luck with your new theme, and if you have any tips on other things to check, please share in the comments!