Use separately the links of $links
You can add variables in hook_node_preprocess in the template.php file in your theme.  Something like:

function MY_THEME_node_preprocess(&amp;$vars) {
  // EXAMPLE: add variable according to view mode.
  switch ($vars['elements']['#view_mode']) {

    case 'teaser':
    $link_text = t('Add new comment...');
    // Build render array for link.
    $link = array(
      '#theme' =&gt; 'link',
      '#text' =&gt; $link_text,
      '#path' =&gt; "comment/reply/" . $vars['nid'],
      '#options' =&gt; array(
        'html' =&gt; FALSE,
        // Make sure it jumps to the right anchor point
        'fragment' =&gt; 'comment-form',
        'attributes' =&gt; array(
          'class' =&gt; array('add-comment'),
        ),
      ),
    );
    $vars['add_comment'] = $link;
    break;
  }
}


And then in your node.tpl.php you can check for $add_comment and print it out using render():

    &lt;?php if (!empty($add_comment)): ?&gt;
        &lt;?php print render($add_comment); ?&gt;
    &lt;?php endif ?&gt;


You can probably split out the comment link from $vars if that is neater.