Giving node titles h1 tags? How can this be accomplished?

Comments

JubW’s picture

and also can the h1 tags be configured so that they are only h1 when actually viewing the node and h2 will browsing the node under taxonomy terms and on the homepage. So basically configure so there is always only 1 h1 tag per page

Jeff Burnz’s picture

Modify node.tpl.php

Where you see this:

<h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2>

Replace it with this:

<?php if ($page == 0) { ?>
  <h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2>
<?php } else { ?>
  <h1 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h1>
<?php } ?>

Then...

In style.css look to line 490 and replace code for .node h2.title { etc etc} with this:

.node h1.title,
.node h2.title {
	margin: 0px;
	padding-top: 0px;
	padding-bottom: 2px;
	border-bottom: solid 1px #bbbbbb;
}
Jeff Burnz’s picture

Status: Active » Closed (fixed)