Getting Started With WordPress Theme Development

WordCamp Montreal 2012 was held this past August 18-19, and on the Sunday, I gave a talk about getting started with WordPress theme development (slides are available here). Savoir-Faire Linux kindly produced videos of some of the talks, now available on YouTube. Enjoy!

Update Sept 25, 2012: WordCamp Montreal 2012 presentations will not be available on wordpress.tv because of a faux-go that was used in our videos.

Additional Notes and Errata

3:19 ⋅ Jeremy Clarke talk: Code Faster and Smarter PHP with IDEs Like NetBeans

8:57 ⋅ Mo Jangda talk: Debugging For WordPress Developers

12:39 ⋅ If we adopt a more accurate definition of the term “framework”, it can be a library of code that gets dropped into a theme, as opposed to being a full-blown theme itself. Hybrid Core (http://themehybrid.com/hybrid-core) is a good (and very useful) example. Just make sure to follow the Golden Rule: understand the code you are working with.

13:17 ⋅ I’ve used Underscores myself as the base for my own starter theme, Debut (available in the Free Themes Directory): http://wordpress.org/extend/themes/debut/

18:35 ⋅ The tags listed in the Tags section are not arbitrary; you can find the list of valid tags on the Free Theme Directory’s More Info page: http://wordpress.org/extend/themes/about/ (these tags are only necessary if wanting to submit your theme to the Free Theme Directory)

18:59 ⋅ Tracy Levesque talk: Creating Custom Child Themes for WordPress

20:49 ⋅ From the PHP Manual: “Function names follow the same rules as other labels in PHP. A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*.”

21:03 ⋅ WordPress Coding Standards: http://codex.wordpress.org/WordPress_Coding_Standards

22:16 ⋅ Hm, looks like it could be 7000+(?!) functions that are defined in WordPress core, but not all of them would cause the namespace conflicts being discussed.

25:33 ⋅ For the sake of maximizing compatibility with the wide variety of hosting environments and PHP configurations, always use the full opening tag (“<?php“) and not the short tag (“<?“) when coding WordPress themes and plugins.

34:26 ⋅ Duh. While it’s possible that a theme may include a file called authors.php, the much more likely explanations are that the file is a Page Template (see: http://codex.wordpress.org/Pages#Page_Templates), or gets called by get_template_part() (see: http://codex.wordpress.org/Function_Reference/get_template_part).

38:16 ⋅ Sad face. I actually had demos for both actions and filters, but breezed through for the sake of time. Boo.

41:55 ⋅ Frankly, don’t ever do this at home, kids. Just returning false on a filter may cause problems in places you don’t expect, unless you are absolutely sure you know every occurrence of that filter and everything that may call it. Most likely there is a better way to accomplish what you need. (thanks to @jeremyclarke)

44:24 ⋅ I’m referring to “pluggable functions” here (see: http://codex.wordpress.org/Pluggable_Functions). It turns out pluggable functions, while still used by WordPress itself for backwards compatibility, have fallen out of favour in deference to hooks (aren’t you glad you learned about actions and filters?).

Published by

Kirk Wight

I am a WordPress developer working at Automattic (the makers of WordPress.com). Based in Vancouver, BC, Canada, I am easily distracted and very curious.

2 thoughts on “Getting Started With WordPress Theme Development”

  1. Hi Kirk,

    I have watched your presentation twice now.
    Considering I have been to four wordcamp’s, this was one of the best regarding theme development.
    The mixture of the pictures, and code was great.

    Thanks,

    Chris

Comments are closed.