2
D
e
c
e
m
b
e
r
2
0
0
6
Hello Theme
Well, that was easy:

Generating a theme from scratch is simple, provided that you adhere to a few basic rules. The key to doing it all properly is this: don’t be scared. WordPress can look daunting, but it really isn’t. There’s this Cheat Sheet which helps too.
Rendering content inside WordPress is also straightforward. WordPress rendering is based around what is called The Loop. This is a chunk of PHP that grabs the relevant posts for you and then you can decide what to do with them. It’s vital that you understand what this does. Whilst you can stick with the standard functions that WordPress provides – and there are a lot of them – you can also develop your own PHP functions and use them in The Loop. You may find you need to use PHP output buffering functions, because not all WordPress functions give you the option of returning their result, some just render directly to the web browser. If you’re inventive enough, WordPress is very suitable for low-end content management. Especially since it now has a Wysiwyg editor and some useful standard Roles for users.
For this particular theme, I’ve put a custom Loop inside the functions.php file that the theme automatically loads. All my customisation lives in that file. So when I choose to upgrade WordPress, I’ll need to visit just one file to ensure that my customisations are kept up to date. When you steal reuse a WordPress function to specialise it for your theme, it’s best to rename it by prefixing it with your theme name, otherwise PHP will complain about a redeclared function.


