Collapsing WordPress Widget-Ready Areas & Sidebars

Problem: Theme users need as many widget-ready areas as possible. They’re easy to use and they help keep theme template files clean. But! unused, empty, widget-ready areas, areas waiting for you to add a widget of your choice, hang around waiting to spoil your designs by limiting your styling options. Just as bad, empty widget areas can invalidate your markup. But don’t worry, we can do something about it. Only first, we need to take a closer look at the problem.

Here’s how a typical widget-ready sidebar looks. I’ve taken the code from Automattic’s guide to widgetizing WordPress themes.

<ul id="sidebar">

 <!-- likely awesome stuff -->

</ul>

We’ve got an unordered list and inside of it a statement that looks for the dynamic_sidebar() function. If we’ve registered one, it’ll spit out our awesome stuff: WordPress widgets marked up as list items.

All very good. But what if we start out with no awesome stuff in there? No default widgets? Well, that means our containing ul element will be hanging out there in our site with no li elements in it. A list without list items. Totally invalid and totally unsemantic. Worse yet: what if you were styling that ul with a margin, border, or just positioning it? That styling would stick—even if the widget area was empty. Totally unacceptable.

Thankfully, there’s a fix. Continue reading

Marginal WordPress Themes

For consideration: “Premium” WordPress theme authors are marginalizing their themes by ignoring the GPL. The audience for their themes will become smaller and smaller as “WordPress-approved” themes are pushed to a growing user base through WordPress itself. Yes? No?

The Difference Between Print & Web Design

Print design holds you in place. It keeps your eyeballs bouncing around, it doesn’t let them go. While web design pulls your eyeballs down a path. It tries to channel the raging river of your attention through a site’s little stream.

That’s just my opinion. As a print designer and as a web designer. But here’s my question: what does this mean for blog design and the particular purposes of blogs?

WordPress 2.7 Theming May Change Everything

It looks like Child Themes will be able to override templates in Parent Themes and add new custom page templates in WordPress 2.7. I loaded up the bleeding edge version this morning and tried it out. Works like a charm. Thank you to everyone who helped make this possible. This might just change the way WordPress theming gets done and will certainly make a lot of people’s lives a whole lot easier.

The Most Used WordPress Themes

If theme updating becomes part of the WordPress core experience—like plugin updating did—and if the Most Popular list in the themes directory reflects downloads made through those updates: that’s a pretty decent resource for WordPress users looking for themes. Instead of a list of the most downloaded—and potentially discarded themes—we’ll have a list of the most used WordPress themes.

Custom WordPress Hooks and Filters in Thematic 0.6

Thematic version 0.6 is an upgrade I didn’t intend on making so quickly and there’s been some changes. Here’s a weird one: when every other WordPress theme author is desperately trying to add more and more settings to their theme options page, I took an option out. Even weirder: it made the theme better. How? I started adding custom hooks and filters to Thematic.

This is something I’ve wanted to get started on for a while so I’m glad it’s finally here.

Custom WordPress Hooks in Thematic 0.6

There are two new custom WordPress hooks in Thematic version 0.6: thematic_belowheader() and thematic_abovefooter(). You can find them in header.php and footer.php, respectively. I’m really excited about this small—but powerful—addition to Thematic. Almost anything you can think of can now be loaded into the theme, just below the header and just above the footer, by taking advantage of your Child Theme functions.php.

Now, I haven’t done anything exciting or creative with this yet—that I can show you—but here’s the outline of some functions that’ll get you started on taking advantage of the new hooks. Remember, these go in the functions.php of your Child Themes.

// Hook into the area below the header
function childtheme_helloworld() { ?>
     <h2>Hello World!</h2>
<?php }
add_action('thematic_belowheader','childtheme_helloworld');
// Hook into the area above the footer
function childtheme_goodbyeworld() { ?>
     <h2>Goodbye Cruel World!</h2>
<?php }
add_action('thematic_abovefooter','childtheme_goodbyeworld');

There you have it. That’s all you need to get started with the Thematic custom WordPress hooks. Fool around with it. Try it out with WordPress conditional tags. See what you can come up with.

Now for the filters. I think you’ll be impressed with the power filters give you over your theme. Continue reading