A couple of weeks ago I mentioned that I was playing with the development version of WordPress 3.0 (still in Alpha, may break at random times). As I’m intending to use that shiny new default theme, I decided it was time to have a look at how I do things in general to save effort in the long run.
The first thing was inserting the weight report thingy in those essential daily posts. I had been doing this by using Scott Reilly’s Get Custom Field Values plugin. That’s fine, but it needs some actual code inserted in the template files – several of them for most themes, though this would be cut down to the very handy loop.php in the Twenty Ten theme, which isn’t too hard, but it means that if the theme gets updated, I have to remember to edit it again.
So, I did a bit of tweaking, a bit of reading, and borrowed bits from Get Custom Field Values and another plugin to create a very basic plugin that drops the weight thingy in automatically without actually having to change of the theme files. It also means that if I decide to change to a different theme, I won’t need to edit that one either.
The next thing was the appearance of the site. While I’m generally happy with the look of Twenty Ten, I will want to change a few things, such as the base font. Now I could just edit the style.css file, but this could also cause problems when the theme is updated.
But fortunately, there is another way. WordPress has a very nifty feature called Child Themes – basically, you can have your own theme based on an existing one. All you have to create is a style.css file in which you defined only the styles that you want to change.
I found this really useful article on creating child themes which pointed me in the right direction. My test site is now working with that, and it all seems to be behaving itself nicely.
I’ll be playing with the test site some more over the next few weeks.