<?php if ($teaser): ?> 
<!-- this displays when teaser of this node type is called -->
    <h2 class="title">
      <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
    </h2>
<!-- any code you like -->
<?php endif; ?>
 
<?php if (!$teaser): ?>
<!-- this displays when it's not a teaser -->

    <h2 class="title">
      <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
    </h2>
<!-- any code you like -->
<?php endif; ?>
 