WordPress 3.3 Could Improve Child Theme Integration

According to a recent WordPress trac ticket, theme authors could soon be rewarded with a little nugget of functionality that would make using child themes much more extensible.

The ticket suggests introducing a function that works similarly to locate_template(), but rather than returning the path of the file (in the parent theme only), it would return a URI to the file, thus allowing a child theme to override the parent’s .js, .css and even image files. The proposed function is called locate_theme_file().

According to the suggested patch posted by johnbillion, this is the current method for loading template files in parent themes only:

</p>
<p>wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); </p>
<p>

If locate_theme_file() is introduced, we could instead see functions like these:

</p>
<p>wp_enqueue_style( 'dark', locate_theme_file( 'colors/dark.css' ), array(), null ); </p>
<p>wp_enqueue_style( 'bar', locate_theme_file( 'bar.css' ) );</p>
<p>&lt;img src=&quot;&lt;?php echo locate_theme_file( 'icon.png' ); ?&gt;&quot; /&gt;</p>
<p>

locate_theme_file() would automatically load any of these files via the child theme, BEFORE the parent. Pretty neat huh?

Up to this point, child themes could only override a parent theme’s template files. If theme authors are rewarded with the ability to enqueue many more types of files at the child theme level with this much ease, I anticipate seeing some really exciting new uses for child themes emerging.

Why Joining the WooThemes Theme Club Was the Smartest Decision I Ever Made

Photo by Flickr/Titanas. Used with permission under Creative Commons License.

I first dipped my toe into the WordPress ocean a few years ago.

My first experiences in the late ’90s with LAMP-based systems with popular bulletin board system phpBB gave me a pretty solid foundation for my introduction to WordPress.

At first, – like many other probably – I didn’t have any idea what I was doing, but I had this idea that if I learned the WP core and how themes worked to expand and enhance functionality of a WordPress installation, that the sky would be the limit. It was.

And so I started off like many others have, with a skeleton theme and a lot of curiosity. I soon found though that at its vanilla state, WordPress is pretty darn complicated. This realization led me to look for a good solid framework. That’s where WooThemes comes in.

Disclaimer: I’m a WooThemes Theme Club member (and evangelist) though I’m not affiliated with them in any way and you’ll never see any affiliate links on my blog.

The thing about WooThemes is that they’ve been at it a few years and they’ve got their ducks in a row. And their framework is consistent.

What I’m talking about with “framework”, is how they handle in-theme functionality and element display across the board. Their code is organized, well-commented and documented. And the format is pretty much the same throughout their entire theme library.

So I do some WordPress design here and there (shameless plug) and for most of my projects I turned to WooThemes for inspiration. I think it’s just that I’ve grown accustomed to the ease-of-use and functionality that comes with a WooThemes design, so when I branch out to other companies and discover the same level of quality doesn’t exist in most other frameworks / themes, I’m disappointed.

So for more than a year now, I’ve been a member of their theme club. It’s definitely an investment at the outset. The pricing starts at $125 up front to join the club, with a $15 monthly maintenance fee after that. I decided having PSD’s was worth it from a development point of view though, so I sprang for the Developer subscription. With a $200 up-front fee and $20 monthly maintenance, it is the best investment I’ve made since I started working with WordPress.

WooThemes’ support is unparalleled and you’ll always be in good hands with co-founders Magnus Jepson, Mark Forrester and Adii Pienaar. They’ve also got a host of “WooNinjas” helping in the forums to make sure everybody is taken care of.

And because I design themes that stay largely in the vein of WooThemes’ bread and butter (magazine, business, personal and portfolio themes), I’ve come to rely on their monthly new releases. It’s always a pleasure to see what they come up with next.