0

I use the Zen theme. I tried the solution given in Remove the 'read more' and 'Add new comment' links on the home page but I get a server error.

How can I remove the read more link from the front page?

3
  • I updated the snippet in the other question, no need to create a new one...
    – Berdir
    May 12, 2011 at 12:50
  • @Berdir I tried the edited one but the same error
    – jone
    May 12, 2011 at 12:53
  • @Berdir Now i did like this: function STARTERKIT_preprocess_node(&$variables) { if ($variables['is_front']) { unset($variables['content']['links']); } } and i cleared the cache. the the page is come up but nothing is changed i still see the read more links.
    – jone
    May 12, 2011 at 13:06

1 Answer 1

1

The problem is in the node rendering, not the page rendering. Its a lower/smaller level than the preprocess page. 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.

1
  • @user1094 like you said i copid nod.tpl.php and i removed hide($content['comments']); hide($content['links']); print render($content); i have know idea about php but i guess this one is for read more links. but nothing is changed the read more link still there. could you tell me what to do step-by-step please. I'm using zen theme
    – jone
    May 13, 2011 at 7:53

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