How can i remove read more link from front page in view the whole content text?

Regards,

Comments

barraponto’s picture

Status: Active » Fixed

in your template.php, look for SUBTHEMENAME_preprocess_node and put
unset($variables['content']['links']['node']);

achu68’s picture

Thank you for your replay

There is STARTERKIT__preprocess_node on line 103 and 107 i'm not which one is the right place. i have tested putting on both places, i cleared the cache but nothing is changed. . could you tell me the right place to put that code.

I don't have php knowledge and i'm new to drupal.

Thank you and Regards,

barraponto’s picture

Status: Fixed » Active

when you are building your fist subtheme, you should change every instance of STARTERKIT to your sub-theme name. So if my sub-theme is called 'conway', then my template.php would contain a conway_preprocess_node function. Change the name of your functions in template.php accordingly, then try again.

Also, if it works for you, please close this issue.

xh116’s picture

I think the best way without changing code is to change "admin/configuration/site infomation/default front page"

achu68’s picture

@barraponto when i put that code i get white blank screen. may be i put it in the wrong place. i don't have a php knowledge.

here is the code I have put it

 function mytheme_preprocess_node(&$variables, $hook) {
  $variables['sample_variable'] = t('Lorem ipsum.');
   unset($variables['content']['links']['node']);

  // Optionally, run node-type-specific preprocess functions, like
  // mytheme_preprocess_node_page() or mytheme_preprocess_node_story().
  $function = __FUNCTION__ . '_' . $variables['node']->type;
  if (function_exists($function)) {
    $function($variables, $hook);
  }
}

what is the wrong?

@torrencechen i'm using Drupal 7

barraponto’s picture

@achu68 is your subtheme called mytheme? anyway, it shouldn't give you a WSOD. try reading your php/apache logs.

cswebadmin’s picture

torrencechen: "I think the best way without changing code is to change "admin/configuration/site infomation/default front page"

This resolved my issue perfectly for a website running drupal 6.0 .

~Thanks for the info.

aaronmacy’s picture

When I add your code, I get the following error: "Notice: Undefined variable: variables in include_once()" with a reference to the line I've just added. Thoughts?

johnalbin’s picture

Status: Active » Closed (fixed)

closing old support issues