How to show the year in K2 articles?

October 2012 Joomla Template
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
Fri Aug 23, 2013 1:02 am
Reply with quote
Report this post
How do I show the year in K2 articles? Today it only shows the day and month. We have several articles from 2012 and earlier.

See attached, thanks!

Nick
User avatar
Fresh Boarder

GK User
Fri Aug 23, 2013 6:52 am
Reply with quote
Report this post
Single article or blog roll also?
User avatar
Moderator

GK User
Thu Feb 20, 2014 5:01 pm
Reply with quote
Report this post
Is there an answer to this question? I would like to display the year as well.
User avatar
Fresh Boarder

GK User
Sat Feb 22, 2014 11:23 am
Reply with quote
Report this post
You need to edit those files:
templates/gk_startup/html/com_k2/templates/default/category_item.php
templates/gk_startup/html/com_k2/templates/default/item.php
templates/gk_startup/html/com_k2/templates/default/latest_item.php
templates/gk_startup/html/com_k2/templates/default/tag.php
templates/gk_startup/html/com_k2/templates/generic.php

In each find this block:
Code: Select all
<time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>">
   <?php echo JHTML::_('date', $this->item->created, JText::_('d M')); ?>
</time>

And replace this line:
Code: Select all
<?php echo JHTML::_('date', $this->item->created, JText::_('d M')); ?>

with
Code: Select all
<?php echo JHTML::_('date', $this->item->created, JText::_('d M, Y')); ?>
User avatar
Moderator


cron