Drupal 7 Change Presented as

I am new to drupal, but learned fast. I have drupal 7 and am working on creating a theme based on the Zen starterkit subtopic. I am trying to find where I can configure the "Presented" line.

The default value is as follows:

Submitted by kenny on Sun, 05/13/2012 - 18:33

I would like to change it so that it simply indicates the date in a good format (without username, time).

Sunday, May 13th, 2012

How and where can I change this?

+5
source share
2 answers

In your template.php file (under Zen themes) put this.

function mytheme_preprocess_node(&$vars, $hook) {
$vars['submitted'] = date("l, M jS, Y", $vars['created']);
}
+18
source

If you want to set “Presented” and change the formatting date for a certain type of content, you can also change your tpl file, for example

""

node--blog.tpl.php

<?php if ($display_submitted): ?>    
  <p class="submitted">
    <?php $user = user_load($node->uid); ?>
            <?php $username=$user->name; ?>
    <?php print t("Written"); ?>
    <?php print $username ?>
    <time pubdate datetime="<?php print $submitted_pubdate; ?>">
    <?php $date = date("d.n.Y", $node->created); ?>
    <?php print "<br>".$date; ?>
    </time>
  </p>
  <?php endif; ?>
0

All Articles