9

How do you remove or modify the list of links shown after the content?

14

In your theme's template.php file, add this snippet:

function THEMENAME_preprocess_node(&$variables) {
  if ($variables['is_front']) {
    unset($variables['content']['links']);
  }
}

Remember to clear the cache afterward. And replace THEMENAME with your actual theme.

  • @tim.plunkett I use zen theme when i insert your code inside my template.php i got server error message. what should i do? THanks, – jone May 12 '11 at 9:03
  • Fixed the code. – Berdir May 12 '11 at 12:50
  • @Berdir i did like this: function STARTERKIT_preprocess_node(&$variables) { if ($variables['is_front']) { unset($variables['content']['links']); } } and i cleared the cache. the page is come up but nothing is changed i still see the read more links. What should i do? – jone May 16 '11 at 7:32
  • I'm no sure, try to see what value $variables['is_front'] has by printing it out, maybe you need a different condition – Berdir May 16 '11 at 9:03
  • You could also comment out the if completely, then the links should be always be hidden. And of course, make sure that your function is actually called, did you clear the theme registry cache and so on? – Berdir May 16 '11 at 9:04
0

Modify the node template...

You can use node template overrides such as "node-fonts.tpl.php" where "fonts" is the name of the node type. You will copy "node.tpl.php" to make this then modify it to your liking. This template is found in "[SITE ROOT]/modules/node/". Copy this to your theme folder. When I do this I create a subfolder called "node" to help organize the theme overrides.

If you want an easier solution then I would use ConTemplate (otherwise known as Content Template). This will allow you to control this from the content type admin config (creates a template tab which has options for the teaser and the full node). This also provides details about the available variables and sample data from the last inserted node of the type you are looking at.

protected by kiamlaluno Mar 28 '12 at 10:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.