WordPress Theme Editing Part 1: Surviving The Process
By AndrewBoyd • Feb 6th, 2008 • Category: Blogging tipsThis is part 1 of a guide to editing/customising themes on self-hosted WordPress blogs. When I changed On Blogging Australia over to the new theme I promised to talk about how I did it - and quickly found that there were a few things that I knew that would be useful to other people. So here it is in three parts:
- Part 1 (this part) looks at a few basics and what you should know prior to touching a theme/template file so that your blog will survive the process,
- Part 2 will cover three common programming/markup languages that you will encounter when editing theme files, and
- Part 3 will discuss the new On Blogging Australia look - how I took an available theme and made a few basic changes to it to create my own look.
What is a theme?
WordPress themes are collections of files - usually PHP and CSS - that govern the look and feel of your blog. They live in subdirectories in your web server file structure under something like /domainname.com/html/wp-content/themes/ - the domainname.com and html parts of the file path will vary from hosting setup to hosting setup depending on what web server they use and how they have it configured - if you go to look for this yourself, the important part is the /wp-content/themes/ subdirectory. This is where you can FTP new themes too, but that is a story for another day.
You can have a look at the files that your blog is using right now by going to Dashboard > Presentation > Theme Editor. I suggest that if you are new to theme editing that you read the rest of this article before actually editing any files. The rest of the series would be useful too - but if you follow the advice in this article then your blog will probably still be around tomorrow
Why edit themes?
With so many themes available, why would you want to customise one? There are hundreds and hundreds of themes available from collections (like the WP Theme Viewer) and there is something to suit everyone. Or is there?
Basically, no. Most themes are OK out of the box, but if you want to make them really work for you, most of them require some customisation.
Two reasons to customise themes include:
- Differentiation/Individuation/Branding/call it what you will: standing out from the crowd might be as easy as changing some colours and a couple of fonts, or you may want to totally change your theme’s layout so that you don’t look like every other blog using the same theme.
- Functionality: there are many themes that do not support the WordPress way of sidebar widgets, so you either need to change the template to support them, or add sidebar components manually.
How do I change my theme?
The answer to that one is easy - you need to change it carefully. Editing theme template files is the easiest way I know to totally take your blog off the air - and you can do it yourself very efficiently if you are the Administrator of your own self-hosted WordPress blog.
The editing and testing process is covered below - but the first thing that I recommend you do is get the Theme Test Drive plugin.
Why get Theme Test Drive?
Because Theme Test Drive can save you from yourself. It means that you can play with one theme to your heart’s content without taking your blog off the map, no matter what you do to your theme template files.
To use Theme Test Drive:
- Download it from here.
- Unzip and FTP the files to your /wp-content/plugins directory.
- Use Dashboard > Presentation > Theme Test Drive to enable/disable test drive and to choose the theme that will be available to Administrator-level users only (i.e. the one you want to test drive).
- Once it is enabled, then you go to Dashboard > Presentation > Theme Editor to play with the test driven theme (being sure to select the right theme to play with under the “Select theme to edit”, because the current publicly viewed theme will be the default). This infers that you have at least one theme free to play with - if you need to, FTP another theme to your /wp-content/theme directory (after downloading and unzipping it).
Good coding practice
Surviving the coding process is increased dramatically by adding a little rigidity to the process. Here are some tips that I’ve found useful:
- Never edit the only copy of any file: keep a copy on your hard disk before editing the online version, and whenever you make substantial changes take another copy and store it separately. A lot of people keep the original file in a separate text editor (like NotePad or WordPad) window, just in case they need to copy-paste the original back in a hurry.
- Watch for interrelationships: themes are complex creatures - the different parts inter-relate in a way that often varies from theme to theme. Generally speaking, the position/colour/font/font size/etc of various theme elements will be controlled by one or more CSS stylesheet files, and the number/type/category of your posts will be governed by one or more PHP files (there is a lot more to it than that, but these are the basics). I say “generally speaking” because theme designers can run pretty wild and free with these conventions. What you do need to be aware of is this: when you edit one file, it can sometimes affect how things in other files behave.
- Comment, comment, comment: commenting is important - documenting what you’ve changed and where will help you to understand what you’ve done after it fades from memory. It is a good habit to get into. Because commenting formats vary from coding language to coding language, I’ll cover them in the next part of this series.
What next?
In the next part of this series I’d like to talk about the coding itself - I’ll cover some basics of the three main languages that you’re likely to encounter and provide some examples that you can use within your own blog. In part three I’d like to show you the process I went through to change On Blogging Australia.
If there is anything else that you would like covered in more detail please leave me a comment ![]()
AndrewBoyd is a consultant by day and blogger by night. He loves good food, good wine, and discussing faceted classification schemes with friends.
Email this author | All posts by AndrewBoyd



[…] is part 2 of a guide to editing/customising themes on self-hosted WordPress blogs. Part 1 looked at how you can survive the […]
[…] is part 2 of a guide to editing/customising themes on self-hosted WordPress blogs. Part 1 looked at how you can survive the […]
[…] is part 3 of a 3 part series on WordPress theme editing. Please feel free to read parts 1 and 2 if you […]