With this theme we get two h1 tags on nodes. Page title and site title are h1 on every page except frontpage where only site title is h1. I wanted to accomplish that site title is h1 ONLY on frontpage, and on other pages the PAGE TITLE to be the only h1.
So I excluded h1 from site title by removing this from page.tpl.php:

<?php if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></h1>

and replacing it with this:

<?php if ($site_name) { ?><div id="site-name"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></div>

and adding to style.css this

#site-name { font-weight: bold; font-size: 30px; }

So I removed h1 from site title. But on every page. And I wanted site title to remain h1 on frontpage, and since I have no experience in php, don't know how to do it. Can anyone help?

I have found solutions for other themes, but didn't manage to successfully implement it on this one, like this from Zen theme:

<?php if ($is_front): ?>
  <h1 id="site-name">
    <a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>" rel="home">
    <?php print $site_name; ?>
    </a>
  </h1>
<?php else: ?>
  <div id="site-name"><strong>
    <a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>" rel="home">
    <?php print $site_name; ?>
    </a>
  </strong></div>
<?php endif; ?> 

Comments

sedmi’s picture

Status: Active » Closed (fixed)

Here is the solution I got from from "happy" at digitalpoint forum:

<?
if($_SERVER[REQUEST_URI]=="/") { if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?></h1> <? } 
else { if ($site_name) { ?><div id="site-name"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php 
} ?></div><? } ?>