a blog about handmade code

Customizing Submitted By Theme

Customize the submitted by block by adding this code to the template.php. Remember to change the bolded theme_name_preprocess_node with the name of the theme.

function theme_name_preprocess_node(&$vars, $hook)
{
$vars['submitted'] = t
(
'Published by !username at @datetime - !comments',
array
(
'!username' => $vars['name'],
'@datetime' => $vars['date'], //date("j F Y", $vars['created']),
'!comments' => l
(
format_plural($vars['comment_count'], '1 comment', '@count comments'),
drupal_lookup_path('alias',$vars['uri']['path']),
array('fragment' => 'comments')
)
)
);
}
Features Used: 
  • drupal 7
  • custom submitted by theme

Add new comment

©2012 Tranzic Media / Portfolio of Vasna Sdoeung