I'm using Garland and I wanted to put H1 tags on the site name for the front page, but on subsequent pages I wanted to put the H1 tags on the page title.

I changed part of the page.tpl.php

FROM:

 if ($logo || $site_title) {
            print '<h1><a href="'. check_url($front_page) .'" title="'. $site_title .'">';
            if ($logo) {
              print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" />';
            }
            print $site_html .'</a></h1>';
          }
        

TO:

 if($is_front){
  print '<h1>' . $site_name . '</h1>';
} else {
  print '<h1>' . $title . '</h1>';
}

THIS WORKED FINE, BUT:

My logo doesn't appear now.

I want to keep the amended code, and keep the new H1 settings, but how do I change it so I can get my logo back?

Can anyone help with the correct code?