You are not the only person who wants to customize your WordPress Theme. And there is no single way to tweak your site. There might be multiple ways to do the same thing. In this post we will discuss the right way to modify or customize WordPress theme.
What’s in the post?
- What options are available and what are the pros and cons?
- When to use panel or plugin or child theme.
- Read this before you start coding.
- Getting started with WordPress Theme customizations
Almost all Most commercial theme available outside the WordPress.org repository have inbuilt plugins and panel. They seem to be easiest way to customize your WP themes. But wait, there is a catch! They might not be the best option available. Or more precisely, they might be a theme lock. Let’s first take a look on the options we have.
You might hire a developer to do things with your site. But it might not be feasible with everyone or just not that complex to ping a developer. So if you are going to customize your theme then it’s better to understand the basics and the right way to do that.
Let’s first talk about the sexiest feature of your theme, the panel. In most premium commercial theme you will get one.
This is an inbuilt feature of most premium theme. But sometimes you might get a panel as add-on plugin. These panels offer you a verity of customizations.
Significance of using inbuilt panel
- Easiest way to customize.
- No need to be a professional or even intermediate user. Everybody can work with it.
- Use plenty of options to tweak your theme and give it a new look.
- Possible Theme lock
- Limited functionality
Using a plugin
You might use a plugin, more precisely custom plugin, to customize your theme. You may literally do many things with your plugin.
Benefits of using a plugin to customize WordPress Themes:
- A plugin will definitely be helpful and give you more flexibility to customize your site
- It can work across your sites under multi-site WordPress install.
- No theme lock. Your customizations will be safe even after switching your theme.
- You should be aware of PHP/HTML/CSS or sometimes MySQL.
- Potentially break your site if you follow some random tutorials or hit and try with your live site.
- You will be responsible for what you are doing and sometimes it will be costlier if you damage your site and do not know how to recover it.
Indeed this is sometimes riskier to use a plugin or child theme but it is most recommended way to try these methods.
You may ask for help any time on WordPress Forums, Stack overflow, your theme support. If everything fails try some paid options like Theme Hybrid Club or even here in our forums. These will not be a guaranteed option but they provide pretty good support and put you in right direction.
Using a child theme for customizations:
This is the most precise option and literally all theme developers recommend this option for advance customization. Here are a few benefits and limitations of Child Themes:
Benefits of a child theme:
- Everybody recommends this.
- Good for advance theme customization
- Will keep your design intact even after parent theme updating.
Child Theme limitations:
- Basic knowledge of PHP/HTML/CSS will be required
- You might break your site if editing on live site.
- Support will be limited in many cases.
Deciding between Child Theme and Custom Plugin
Now you have seen all these options have their own good and bad. You might be confused now. Isn’t it? It’s time to crystal clear the ideas when should one use a plugin and when should a child theme.
- Decide whether your customization is a feature or design! If it is a feature go for custom plugin else a child theme. You could easily distinguish between a theme feature and plugin feature; just think about changing the theme in future if you don’t want to keep those elements with your next theme it would be better to add such customizations to a child theme. [This idea is for layman or absolute beginners. If you know WordPress a little bit you might like to check this link.]
- Features like Custom Post types, gallery, and portfolio belong to plugin territory. You should not use such feature unless you can port them out. Your theme developer who built the theme will tell you how to do that.
- According to Official WordPress theme makers’ documents favicons, advertising widgets, analytics are also a plugin feature and should belong to plugin.
When to use your Theme Panel?
Theme panels are very useful if you use it properly. Unfortunately, Theme developers occasionally violate certain rules and add plugin features to the theme panel. This is a theme lock (or trap). If you use these features you probably want to use their theme for your life. Never use such inbuilt feature unless there is an option port your data out.
The most common example of such feature is product rating.
It will be initially costlier to setup multiple plugin in terms of time and money. But it might be best option. Most popular plugins are well supported in (and outside) WordPress repository. Choose them.
I know many people would not support this idea but in long run it will be useful. If you have different opinions please do share.
Statutory Warning: Editing WordPress Theme may break your site!
How many smokers know “Cigarette smoking is injurious to health”? And, how many of them quit smoking after reading the quote. There might be a few but not in significant number. There is a similar situation here. People start editing themes and plugins on a live site and sometimes they mess things up and blame WordPress or luck. It is highly recommended to edit/test themes or plugins on test server or site. Do not edit a live theme. It may potentially break your WordPress installation. For the sake of goodness, please follow the following rules.
- Always edit themes or plugin on a test server or site.
- Do not hack WordPress core.
- Always debug edited theme or plugin before uploading to live website.
- Test compatibility with other plugins you already have installed on your site.
- Always backup your site before activating your plugin or theme.
If you follow these rules you probably enjoy your blogging life.
Getting started with WordPress Theme customizations
Once you understand be theme territory and plugin territory you will easily get started with customizing your site. You should also aware about theme panel features and theme trap.
Customize WordPress Theme using a plugin
A custom plugin will give you enormous power to hack many things you may download this sample plugin and get started with adding codes to it. Forking the plugin on Github will be better if you have some spare time and want to track every change made. I will discuss how to do that someday.
Here are a few lines of code every plugin should have. As you see these lines give you, and WordPress, an idea about theme name, author name and URL, version and some other information.
You may edit/test and then upload the plugin to your site for safe customizations. Depending upon your theme there might be limitations to modify your theme. But hey, we may use child theme for editing and adding templates.
Customize WordPress theme using a child theme
Child theme is the best possible way to customize your theme. As the name suggest child theme needs a parent theme to work. Yes, the relation is also called parent-child theme. You may also have a grandchild theme. But it will be discussed later.
Like plugins a child theme also need some essential files and some codes to get started. I have created a sample child theme for Twenty Twelve, which you could use to understand the mechanism of the child theme.
Apart from the general information notice the 7th line
template: twentytwelve. This line is required to define the parent theme. The word twentytwelveshould be your real theme slug. This is case sensitive.