Hybrid version 0.7 theme release

Some of you have been waiting months for this update, and the wait is finally over. Version 0.7 of the Hybrid theme is officially ready for download.

There’s loads of changes in store, so this will be a bit of a long post. Feel free to skip straight to the end and download a fresh copy.

Bug fixes in version 0.7

Fortunately, most of the bugs were knocked out in version 0.6.2, so there’s not a ton fixed issues to report.

  • Made sure everything is properly escaped to keep any security issues at bay.
  • The after singular hook was put in a consistent spot across templates.
  • The breadcrumb trail code now respects the “home” page (posts/blog page) title when it’s not the front page.
  • Added a WordPress filter hook to the comment author function to be more compatible with commenting plugins (though most of the plugins don’t properly recognize all WP filter hooks).
  • Standardized the widget text inputs by adding the type attribute, which makes them look a little better.
  • Removed the post-title class from entry titles where it was being inappropriately added.
  • HTML now properly displayed for term descriptions on the front end.

Removal of three page templates

The log-in.php, profile.php, and register.php page templates have been removed from the theme because of several reasons that I’ve previously explained.

If you need those templates, you can still get them from the page templates pack.

Classes folder and widgets move

New to the theme is the /library/classes folder. It houses all PHP classes within the theme. This was mainly introduced for the new Hybrid class, which launches the framework.

I’ve also done away with the /library/widgets folder and moved all widgets into the /library/classes folder because this is a more appropriate location.

Contextual hooks and CSS classes

We’ve always had contextual classes in Hybrid, but these have been cleaned up a bit and are now based off the hybrid_get_context() function. This function creates a cascading flow of contexts based on the current page a user is visiting.

The function also handles the contextual hook system in the theme. One might typically see something like the hybrid_byline hook. Instead of writing all the conditional code yourself, you can just use a contextual hook. For example, you could create a filter function just for the home page byline:

add_filter( 'hybrid_home_byline', 'my_home_byline' );

New and improved template hierarchy

I’ve previously written about the changes in the template hierarchy, so I’m not going into detail here. It should make creating custom templates much easier and more understandable.

There’s also a new tutorial on the template hierarchy, which goes into more detail.

Custom post templates

In WordPress, you can create custom page templates, but you can’t create custom templates for posts. This version of the theme changes that. Now, you can create a file called post-example.php and add this to the top:

<?php
/**
 * Post Template: Example
 */
?>

Then, you can select this on a per-post basis from the post editor. The theme also comes packaged with a No Widgets post template.

New widget options

Several of the widgets have gotten some new settings:

  • Categories widget
    • Added the slug and term_group options for orderby.
    • Added the search option.
  • Bookmarks widget
    • Added a title_li option.
    • Added a search option.
  • Tags widget
    • Added a separator option.
    • Added a search option.
    • Added a name__like option.
    • Added a pad_counts option.
    • Added a parent option.
    • Added a child_of option.
    • Added a hide_empty option.
  • Pages widget
    • Added a number option.
    • Added an offset option.

Completely recoded the theme settings page

I just started from scratch and made a more robust theme settings page. Rather than have a lot of hardcoded, pre-defined stuff there, I wanted to provide a way for plugin and child theme developers to easily extend this. Everything is done by adding meta boxes. So, the user can move the boxes around, hide them, or open/close them.

If you’re a child theme or plugin developer, please take a look at how to create custom meta boxes for the theme settings page. This could be a cool way to spruce up your creations.

I’ve also done away with the meta and indexing options on the theme settings page. There’s just been too much debate over whether SEO options should be a theme or plugin feature, so I decided to leave this to plugins. However, the theme’s defaults and per-post settings are still in place. You have the option of turning these on or off.

And much, much more!

I could spend an entire week writing about all the changes, but I’d probably just bore you.

Overall, I accomplished more than I’d planned for this release. We’ve got a completely context-aware theme in every way possible, loads of action and filter hooks, and more-efficient code. Now, I just can’t wait to get started on version 0.8

Download version 0.7 of the Hybrid theme

Note that this version is for WordPress 2.9+ only. It will break older versions of WordPress, so be sure to upgrade your WordPress install first.

I hope you all enjoy this release and are also enjoying this holiday season.

24 Comments


  1. I have been waiting for this update, a wp 2.9+hybrid 0.7 combo
    Its time to explore it now 🙂


  2. I downloaded it from the WordPress repository a couple of days ago (I just figured that if 0.6.2 was called hybrid.0.6.2.zip, then 0.7 would be called called hybrid.0.7.zip), and it worked, but is it as up-to-date as this one?

    Other than that, I can’t wait to play around with the new custom post-templates 🙂


    1. It should be the same thing as what I submitted last week. For some reason, it just took forever to be updated.


  3. Oh … never mind, I reuploaded hybrid-news (how the hell did THAT get out of date? Mea culpa) and now it’s back!

  4. Kyle D

    Thanks Justin. Looks great. Got my breadcrumbs sorted, and coverted a few hooks to contextual hooks.

    Just a quick question on contextual hooks – how do they compare performance wise? Right now I may have something like:

    add_action("hybrid_before_entry", "my_function") ;
    
    function my_function() {
      if (is_single()) {
         // do something
      } 
      else if (is_page('32')) {
        // do something else
      }
    }

    My question is, would it be better, performance wise to turn that one function into two functions and then do:

    add_action("hybrid_singular_before_entry", "my_function_if_single") ;
    
    add_action("hybrid_singular-page-32_before_entry", "my_function_if_page32") ;

    If you can get contexts such as: hybrid_not-singular-page-32_before_entry in 0.8 I’d be over the moon.


    1. There’ll be a lot of different scenarios, but using two different actions won’t impact performance.


  5. I like the idea of being able to modify the options page via a child theme. That really does allow it to be extended in a very pleasant way rather than having extra theme options pages strewn across the site.

    Great job 🙂

  6. rschilt

    Justin,

    Upgrade to 0.7 went smooth as. Excellent work!!

    A big thanks mate.

    R


  7. Happy New Year to me. Thanks Justin.

    Looks like Ron made a Buddymatic for Hybrid (don’t know the name). I’ll be looking at his code (based on 0.6.2) and making something similar with 0.7 and WPMU 2.9RC1. I’ll let you know how it goes.

  8. thinkjayant

    Wow.. I was waiting for this version. Thanks a ton for releasing it soon. I start working on my first Hybrid 0.7 child theme.

    Regards TJ

  9. king

    usually i got 15 database queries for my blog homepage. after upgrade to hybrid 0.7, it becomes 13 queries only. it’s now faster

    great performance improvement…


  10. Hi Justin, i must thanks you for this release, im very glad 🙂

    As i said before the “$byline” is not fully translateable, it’s hardcoded in /library/functions/hook-filters.php – line 291

    I think you just forgot repair that (:

    Thanks a lot for your effort!

      1. In reply to Justin Tadlock

        Yes, you’re incorrect. It can be translated. Not only have I tested another person’s translation, but I personally just translated it myself in two different ways: 1) a .po/.mo file set and 2) a filter on the gettext text string for the byline.

  11. Stokstaartje

    Just being cautious here: Can I perform the upgrade without having to save the plugin settings? In other words, can I perform a fully automatic upgrade?


  12. I realized that I’ve been using Hybrid on one of my blogs. Gave that up bcs of some bugs like last year, waiting for some upgrades. I’m back and from what I see it’s like a way better then it was before. Thank You for the effort

Comments are closed.