Last active
August 29, 2015 13:56
-
-
Save Greg-Boggs/9102799 to your computer and use it in GitHub Desktop.
Modify submitted by text in two different ways. The better way is in the preprocess function below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="submitted"><?php print $submitted?></span> | |
<?php if ($submitted) { ?> | |
<span class="submitted"> | |
<?php | |
print 'by ' . theme('username', $node) . ' | ' . format_date($node->created, 'custom', 'd/m/Y'); | |
if ($terms) { | |
print ' | in '; | |
} | |
?> | |
</span> | |
<?php } ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//template.php ways | |
function THEME_preprocess_node(&$vars) { | |
$vars['submitted'] = t('Posted by !username on !datetime', | |
array( | |
'!username' => $vars['name'], | |
'!datetime' => format_date($vars['created'], 'custom', 'd/m/y'), | |
)); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment