Adding Class To The WordPress Page Menu

Problem: You need to add a class or id to the the unordered list in wp_page_menu. Maybe to implement some super-slick drop down page menus. But! That <ul> tag is trapped inside of wp_page_menu. What are you going to do?

Solution: Filter wp_page_menu. In the code example below we’ll use preg_replace to find the first—and only the first—<ul> tag and swap it out for <ul id="nav" class="something-classy">. Just drop this code snippet into your theme’s functions.php file and you’re set.

// Add ID and CLASS attributes to the first <ul> occurence in wp_page_menu
function add_menuclass( $ulclass ) {
  return preg_replace( '/<ul>/', '<ul id="nav" class="something-classy">', $ulclass, 1 );
add_filter( 'wp_page_menu', 'add_menuclass' );

How To Change The Postheader in Thematic has written an easy to follow tutorial on how to change the Postheader in Thematic. The Postheader is the content, typically including the title and author info, above each post and page. This is can be one of the most powerful tools in your Thematic toolbox and the same technique can be used to modify the Postfooter. It let’s you take extreme control over what appears above and below all of the content on your Thematic site—without touching a single Template file.

How I Used A Custom Page Template To Redesign My Blog The Smart Way

The custom front page is a must for really taking control of your WordPress installation and using it to manage your website. Luckily, creating a custom front page is ridiculously easy. It’s something every WordPress tinkerer should tackle at least once.

Take a look at the custom front page I created for ThemeShaper. I’ll tell you exactly how I created it using a custom page template and even let you download the one I’m using here.


Continue reading

Personality and WordPress Themes

What will happen to the WordPress Themes community as the main portal for theme downloads moves from a host of developer sites and their interlinked communities to the individual WordPress administrator’s Theme Panel—much like what has happened, and is happening, with WordPress Plugins?

I imagine this will have an effect on pay-to-download WordPress themes. Every year there are more and more new WordPress users, and every year there will be more and more users using only the Themes Panel to find their WordPress themes. And likely limiting their search to the top 15. I predict these users will rarely seek out, or even consider, other theme choices.

But what will happen to the free WordPress Theme community that produces the themes hosted on the current directory? What will happen when the personality of the theme designer is muted? When their ego can’t be fed with traffic and links and what have you? When no one knows or cares about them. When their theme is just another thing on

What then?

Don’t get me wrong, I like the WordPress theme directory and I’m anxiously looking forward to Theme update notifications and automatic download-updates. I just worry that where we’re gaining a strength we’re also gaining a major weakness.

Thematic 0.8 is live

Thematic 0.8 is live and ready for download! The main upgrade is, of course, comment threading for WordPress 2.7+. International users will note some fixes to localization. Thematic hackers will notice some bugs have been fixed.

More exciting to me is what will happen with Thematic 0.9 and eventually version 1.0 (if you’ve got a feature request, I’d love to hear it in the comments). Thematic is shaping up to be a very strong theme, with some strong people behind it. That’s people as in coders and you, the Thematic users. I think you’re all great. Thank you.

Two things to note

  1. We broke your sidebars.

    The Thematic sidebars have been future-proofed for further enhancements (like extra widget-ready areas in Child Themes). Unfortunately change brings complications. There’s no real easy way around it. Before you replace the 0.7 version with 0.8 copy-paste the content of any text widgets into a text file and take note of your widget order. Then proceed to the Thematic Options page and hit the reset widgets button. Easy as cake but the reset button will exterminate your existing widget setup with extreme prejudice. It’s a pain but you’ll only have to do it once and you’ll have rock-solid sidebars from here on in.

  2. I also broke your menu

    If your Child Theme uses #menu in it’s CSS to target the navigation menu you’ll want to replace it with .menu. It should take 3 seconds to find and replace. If you’re using a Thematic Themelet like Travailler or Acamas this fix has already been emailed out to you.

    Plus, the globalnav filter is gone. Long live wp_page_menu! Here’s how to filter your menu now.

    function sample_nav() { ?>
        <div class="menu">
                <li><a href="#">Oh</a></li>
                <li><a href="#">Hello there!</a></li>
        </div><!-- .menu -->     
    <?php }
    add_filter('wp_page_menu', 'sample_nav');

    If you’re using an existing function that filters wp_page_menu it’s a simple matter of replacing that string of text with wp_page_menu.

Join The Thematic Project

I’m looking for co-maintainers for the Thematic project to help make Thematic one of the best WordPress themes available, free or “premium”. Specifically, I’m looking for motivated people to help with the following:

  • Localization: going through the template files and translation files, making sure everything is up to snuff. The future of any successful WordPress theme hinges on universal adoption and I’d like Thematic to be one of the easiest to localize.
  • Comments: the in-development latest version of Thematic threads comments like PHP-based Singer but I want to make sure it’s doing it the right way. It needs a once over.
  • Bugs: there’s still a few bugs in Thematic—one I found this morning is particularly annoying. I’m just a PHP hack. Thematic needs a committed enthusiast who likes squashing things like this.

Continue reading