Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a very simple modification to the code you use in node.tpl.php so you can display your author/date/comments metadata a minimally.
If you want this:
By jibbajabba on 21 Feb | 1 comment
Rather than something like this:
February 21, 2007 - 10:06am
jibbajabba's blog | 1 comment
You can use this snippet in your node.tpl.php file:
By <?php print $name; ?> on <?php print format_date($node->created, 'custom', 'd M'); ?> |
<?php
print $node->comment_count . ' comment';
if ($node->comment_count != 1) { print 's'; }
?>
Comments
Clean-up
Better use http://api.drupal.org/api/function/format_plural/.
Better leave the node object alone, as much as possible.
Use
$name
instead of$node->name
to get a link in the right context.