Code:
<h2><?php if( !is_single() AND !is_page() ) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php if (function_exists('the_title_attribute')) { the_title_attribute(); } elseif (function_exists('the_title')) { the_title(); } ?>"><?php } the_title(); if( !is_single() AND !is_page() ) { ?> </a><?php } ?> </h2>