WordPress Best Practices

| |

Word Press can be done one of two ways: really well or so terrifyingly badly that you'll fall to your knees screaming 'why?'. But, jokes aside, it's an absolutely astonishing piece of software that enables any level of developer to install, customize and sell.

This isn't always the good thing it's made to sound, since more often than not you'll be given a project that will just cause you issues. But another thing that's great about Word Press is that it has a very thorough, well-thought-out framework powering i t, so re-factoring any install is a simple and very smooth procedure. Most of the work is usually in the theme's functions.php ; I find the best way to keep this file workable and maintainable is to create a folder in the theme directory called lib and make separate files for the different pieces of functionality of your theme.

On top of separating functionality into different files and including in your functions.php the location of different pieces of code such as headers, footers, articles and sections (otherwise you will end up chasing code around your different themes' files), your meta information, style sheet s, favicons and the opening <head> tag should all go in the header. php. The article, aside, section, nav elements. and so on. should go in any of the single.php, post.php and other body template files - and of course your footer elements should go in the footer.php.

You'll also find that not enough internet tutorials utilize the built-in WordPress functions to attain the functionality you're looking for. Most if not all of what you want to do can be achieved by using WordPress's integral functions, and I encourage you to use them as much as humanly possible. They protect you and your shop from security threats, they're optimized  and you'll never have much of an issue learning how to use them after reading the Word Press Codex (http://codex.wordpress.org).