CHAPTER 4 • WordPress Theme Essentials 75
bloginfo( 'name' ); ?>">
<?php bloginfo( 'name' ); ?>
This is pretty straightforward stuff. When you get to the actual content, you’ll see that just as
you have a body_class() supplying style sheet classes for the body tag, you’ll have one
for your posts as well. The idea is to give more control over the design and make it possible for you
to style specific parts of the site. Maybe you want the background for pages belonging to a
specific category to be yellow; well, this is the way you do that — just add the appropriate style
to your style sheet, and you’ll be good to go.
The site title is outputted with bloginfo() — nothing fancy there. However, I believe that
the site title shouldn’t be wrapped within h1 tags on single pages but only on the front page
as that is the only place the site title is the most important item. This is why I’ve put another
conditional check here, wrapping the site title in h1 or div tags, depending. The same
obviously goes for the site description, which is within this check as well.
Finally, there’s the menu. This code replaces div.menu and ul list with wp_nav_menu().
This is the tag to output menus, but to make it work, you’ll have to add support for it in
functions.php. You’ll get to this later; for now, just leave it there. Should you want to test your
theme before fiddling with functions.php, just comment this part out to avoid confusion.
And that’s it — header.php is done! Now that wasn’t so hard, was it?