Display the Year

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
Sun Mar 02, 2014 7:03 pm
Reply with quote
Report this post
I can't figure out how to display the year in the Joomla and K2 articles in the Shop & Buy template. The date is displayed, but only the month and day are showing up. I checked (I think) all of the language files, and the template, but no luck.

Any help would be appreciated.
User avatar
Fresh Boarder

GK User
Sun Mar 02, 2014 8:07 pm
Reply with quote
Report this post
That would require editing some core template php files - are you ok with that (I'll provide complete information what to edit)?
User avatar
Moderator

GK User
Mon Mar 03, 2014 5:29 pm
Reply with quote
Report this post
That would be great. Thank you!
User avatar
Fresh Boarder

GK User
Wed Mar 05, 2014 6:19 pm
Reply with quote
Report this post
In all those files:
/templates/gk_shop_and_buy/html/com_k2/templates/default/item.php
/templates/gk_shop_and_buy/html/com_k2/templates/default/category_item.php
/templates/gk_shop_and_buy/html/com_k2/templates/default/last_item.php
/templates/gk_shop_and_buy/html/com_k2/templates/default/tag.php
/templates/gk_shop_and_buy/html/com_k2/templates/default/user.php
/templates/gk_shop_and_buy/html/com_k2/templates/default/generic.php

you need to find this line:
Code: Select all
<li class="itemDate"> <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
        <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>"> <?php echo JHTML::_('date', $this->item->created, JText::_('F j, Y')); ?> </time>
</li>

and change it to:
Code: Select all
<li class="itemDate"> <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
        <time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>"> <?php echo JHTML::_('date', $this->item->created, "F j, Y"); ?> </time>
</li>

Now it will display month, day and year after coma.
User avatar
Moderator


cron