Year on date.

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Nov 19, 2013 3:09 am
Reply with quote
Report this post
Hi. How i can i add the year of when the article has been created in blog style?
Id like to add the year bgelow the month.

Thanks
User avatar
Expert Boarder

GK User
Tue Nov 19, 2013 6:29 pm
Reply with quote
Report this post
Please open file template/html/category/blog_item.php and find this part :

Code: Select all
<?php if ($params->get('show_create_date')) : ?>
      <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>">
         <?php echo JHtml::_('date', $this->item->created, JText::_('d M')); ?>
      </time>
      <?php endif; ?>


then replace it to :

Code: Select all
<?php if ($params->get('show_create_date')) : ?>
      <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>">
         <?php echo JHtml::_('date', $this->item->created, JText::_('d M Y')); ?>
      </time>
      <?php endif; ?>


Of course if you mean default Joomla! blog layout not the K2 one :)
User avatar
Platinum Boarder

GK User
Tue Nov 19, 2013 6:58 pm
Reply with quote
Report this post
Hi.
No.I mean the K2 layout. Sorru for not saying it before...
User avatar
Expert Boarder

GK User
Tue Nov 19, 2013 8:28 pm
Reply with quote
Report this post
Ok, so now you need to open file template/html/com_k2/templates/default/category_item.php and find this part of code :

Code: Select all
<?php if($this->item->params->get('catItemDateCreated')): ?>
      <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>">
         <?php echo JHTML::_('date', $this->item->created, JText::_('d M')); ?>
      </time>
      <?php endif; ?>


and then replace with :

Code: Select all
<?php if($this->item->params->get('catItemDateCreated')): ?>
      <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>">
         <?php echo JHTML::_('date', $this->item->created, JText::_('d M Y')); ?>
      </time>
      <?php endif; ?>
User avatar
Platinum Boarder


cron