Display only some of the links

Last modified: August 26, 2009 - 22:59

The default template shows "read more | add new comment" but I want only the "add new comment" link.

You can add the first function from Customising how links ($links) are displayed in your pages to your template.php file and then simply create your links.tpl.php file with the following lines:

<?php
$link_count
= count($links);
print
$links[1];
?>

In your node.tpl.php template keep:

<?php
print $links
?>

wherever you want the links to appear.

That's it. It worked for me. Maybe, in your case, you have to change number '1' (the $links array index) to some other number (try 0 or 2, maybe). If you want a different $links template on a taxonomy or node-type basis, just have to add some conditionals to the links.tpl.php file, what it's well documented within this very site.

 
 

Drupal is a registered trademark of Dries Buytaert.