By akael on
I am working on a site with a blog, and on the blog I would like to show the submitted by with the date only, not time.
Can anyone help with this?
Drupal 7 by the way.
Thanks.
I am working on a site with a blog, and on the blog I would like to show the submitted by with the date only, not time.
Can anyone help with this?
Drupal 7 by the way.
Thanks.
Comments
I looks like they changed it
I looks like they changed it in Drupal 7. It used to be that you had to use theme_node_submitted() (http://api.drupal.org/api/drupal/modules--node--node.module/function/the...) but, it is now a little easier.
1. You want to ONLY alter the blog template. So to do that you need to duplicate the node.tpl.php file in your template.
2. Rename the duplicate to node-blog.tpl.php (assuming that "blog" is the content type).
3. Clear your Drupal cache (/admin/settings/performance).
4. Now you can edit node-blog.tpl.php as needed. You will see the code:
Change it to...
The "F j, Y" part can be changed to match what format you want. See http://us.php.net/manual/en/function.date.php for specifics on what letters/values are available.
Mmm...actually this is
Mmm...actually this is another/better way to do it. Follow the 4 steps above but add the following...
1. Go to admin/config/regional/date-time
2. Click on the "Formats" tab
3. Click "Add format"
4. Create a format string (see the link to the PHP manual in the field description).
5. Once the format is created, click on the "Types" tab.
6. Click "Add date type"
7. Date type name: dateonly
8. Date format: select the format you just made out of the date format drop down (it should be at the bottom)
9. Change
to
You are amazing! Thank you
You are amazing!
Thank you very much.
Thankee vicar!
Thankee vicar!
Arp Laszlo
bricksandclicks.marketing
design / theming / development / consulting