Ian Stewart has been hard at work experimenting with WordPress – first with the Thematic framework, and now with some awesome child themes. He’s also played with custom hooks and filters, and now includes some pretty helpful ones with Thematic. Confused? You probably are. Let’s get down on a more basic level and learn what Ian is doing, and then you’ll see why his latest work has been so influential.

    Theme Frameworks

    For those of you that have never heard of a framework, it’s a piece of software – or in this case, a WordPress theme – that includes many extra functions that you can use when developing a theme. For example, jQuery – a popular JavaScript library – uses JavaScript, but it automates many complex tasks by providing you with a simple function to accomplish them.

    In many ways, Thematic is built in the same way. It’s a WordPress theme, and can be used right out of the box if you want. But it can do so much more. Using additional filters and actions provided by Thematic, you can extend your site even further by using this theme.

    Child Themes

    Fact of the day: Thematic is a theme. But it’s a parent theme. To understand this concept, let’s think of a regular WordPress theme, and how it works with WordPress. Think of WordPress as the parent theme, and your regular theme as the child. WordPress provides all sorts of useful functions to get data, from permalinks and titles to a list of categories and a tag cloud. Themes can utilize these functions to call data and organize it on the page.

    Child themes with Thematic work exactly the same way. In addition to using the built-in functions provided by WordPress, they can use the extra hooks, actions, and filters that Thematic provides. They can also take advantage of the other great features Ian has built into Thematic, such as search engine optimization, grids based on the 960px grid system, CSS resets and frameworks, and 13 different widget-ready areas – just to name a few.

    Filters

    Let’s say you want to control how your post title is displayed depending on what page it is on. Normally you’d have one title in 404.php, another in archive.php, which is usually the same as index.php, but a different format than page.php, and so on. With Thematic’s built-in filters, you can control all of these titles from one file. Use conditionals to determine which format is to be used, and call the entire title set via a function in any of your theme’s files. It’s that easy. Visit Ian’s blog to see the code for this example.

    Hooks

    Hooks have the same function as wp_head() and wp_footer(). You can put them anywhere in your theme, and other files and plugins can add content to that area. For instance, wp_head() (which is built into WordPress) is often used by plugins to add JavaScript and CSS links to the header. There are two custom hooks in Thematic 0.6: thematic_belowheader() and thematic_abovefooter().

    //hook into the area below the header
    function childtheme_helloworld() { ?>
    

    Hello World!

    Using this code,

    Hello World!

    will be inserted just below the header. If enough hooks are provided in the future, this could completely eliminate the need to manually place functions into your theme to include information from plugins, such as pagination and breadcrumb links.

    Future Plans

    Thematic development certainly isn’t done yet. Ian has a list of changes he’s considering for version 0.7, including more hooks, stylesheet organization, and completely merging Sandbox with Thematic completely.

    Conclusion

    Hopefully by now you have a better understanding of what all the Thematic hype is about. Ian is certainly doing some awesome stuff, and I can’t wait to see what else gets thrown into Thematic in the future. What else would you like to see Thematic do? Sound off in the comments.

    Additional Links

    Post Revisions:

    There are no revisions for this post.

    Tagged with:

    About the author:

    19 Responses to Frameworks, Child Themes, Filters, and Hooks?

    1. Hi Dan, excellent intro & overview of child themes. I just found Ian’s site last week and started playing around with Thematic. The possibilities are endless and for people like me who are more design oriented than code oriented, this makes life a whole lot easier.

    2. jbj says:

      Thanks for posting this on WpVote! I really enjoyed reading your article. Parents/children themes seems very interesting, I must learn more on that subject!

    3. adrian says:

      Because that’s what WP needs… another layer of complexity!!

      I jest, I jest.

      Nice article.

    4. [...] Candy has a lot of different goodies and articles about WordPress and the latest today is about Frameworks, Child Themes, Filters and Hooks. It’s a pretty extensive article but it brings up a lot of good things and tips when [...]

    5. Semiologic Pro was much like what you describe two years ago.

      We’ve taken the entire approach well beyond that since.

    6. I don’t know why people talk more about Semiologic Pro more. It was also the first Premium theme too, wasn’t it, Denis?

      Semiologic Pro has a built in layout switcher and skin switcher too, right? (Not something I’d be interested in for Thematic.)

    7. I don’t know why people talk more about Semiologic Pro more

      Should be, “I don’t know why people don’t talk about Semiologic Pro more.” As in, “because it has a lot of cool features.”

    8. [...] there is a solution and that solution is a WordPress Theme Framework. From WPCandy.com: For those of you that have never heard of a framework, it’s a piece of software – or in this [...]

    9. greate artikel!
      LG from Austria

    10. [...] Frameworks, Child Themes, Filters, and Hooks? [...]

    11. [...] Frameworks, Child Themes, Filters, and Hooks? A good writeup by Dan Philibin of WP Candy on the concept. [...]

    12. [...] Frameworks, Child Themes, Filters, and Hooks — further explanation with guides to having them play nicely with other parts of WordPress. [...]

    13. [...] Frameworks, Child Themes, Filters, and Hooks? [...]

    14. [...] 테마란 “PARENT/CHILD THEMES IN WORDPRESS: THE FUTURE OF WORDPRESS THEMES“, “Frameworks, Child Themes, Filters, and Hooks?“, “Why I created a WordPress theme framework“과 같은 포스트에서 [...]

    15. I have a plan to use a theme framework for my wordpress blog. Thanks for information.

    Leave a Reply

    Please note that WPCandy is a moderated community.

     

    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>