Making WordPress custom themes at #wordcampuk

blue-l

Jonny Allbut’s session at Word Camp UK was called ‘Build a custom theme in one hour’ – a huge ask; so tactically he renamed it to ‘Suicide by live code demo’.

Jonny shared some great advice for WordPress users creating their own themes. Here are some of the takeaway notes you may find useful:

1. Set a widget area. Hardcoding features into a website could cause trouble later. By just implementing a widget area the site will be flexible and allow for changes to be made and new features to be added with minimal effort.

2. Use a framework to do the heavy lifting for you. Jonny suggested commercial or free are both fine, but he prefers Wonderflux because it is great for PHP ninjas and n00bs alike (plus free and open-source).

3. Change elements of a frame work with parent / child theory. Just create a child theme with the same name as the parent theme, and it will override the theme. This helps when designing a theme in one hour!

4. Avoid repeating code by using get template part principle. Create header-content.php, loop-content.php and sidebar-content.php in the child theme so you don’t need to copy and paste.

5. Use a grid system as this allows for changes late on in the design process. You may be 95% into the final design, but by using a grid system you could make changes that would otherwise delay the work hugely.

6. Avoid text breaking out of header or ribbon boundaries by creating 1pixel wide repeating div line. This will mean if text size is changed, the header will resize perfectly and expand to fit.

If you are at WordCamp UK, Jonny is around to give out even more tips. As his rename to the session suggests, Jonny had to rush the process, so if you are at WordCamp UK Jonny is around for more advice and tips. Also chat to him if you’re a jQeury developer – he is on the lookout ;)

Published by David

David is a social media and tech gadget geek. You’ll usually find him blogging about the latest social networks, lauding them as the next big thing, or rambling on about the latest features on Windows Phone.

2 Comments So Far, what do you think?

  1. herb miller

    It was a great presentation. At present I use Artisteer to generate basic sites for WordPress and Drupal. But I also have a plugin (called oik) which includes parts of the blueprint.css style so that I can control layouts in posts where necessary.
    One thing I noticed, and mentioned to Jonny afterwards was a potential problem in his h1 tag in the header. I’ve just written about an actual instance of the problem at http://fobbonghide.co.uk/dotcom/2011/07/16/fob-bong-for-bobbingwidewebdesign-com-oik-and-artisteer/

  2. Jonny Allbut

    Thanks for featuring Wonderflux and sponsoring the event guys, my girlfriend instantly stole the 1 Critter badge I had, but love the t-shirt and stickers;)

    Just following up on Herbs post, he did catch me quickly after the presentation to mention this issue. I double checked my code from the demo and although some of it was written in a bit of a rush my code was actually fine. To clarify, Herb had not noticed I was running it through esc_attr() to sanitise the output.

    Herb is actually correct though in saying on his blog that the best function to use in the ‘title’ attribute of a link would be the_title_attribute(). Worth mentioning is the_title_attribute() has an ‘echo’ parameter, so you can return the value for further PHP manipulation if required.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>