Postnote -Large Date - Featured Article - J2.56

Elegant Joomla template designed especially for both professional and personal website presentation.
GK User
Mon Aug 27, 2012 10:52 pm
Hi,

I have seen several posts wishing to delete the large date in the first featured article. Is there a way to replace the article 'created' date with a large 'today's' system date?

Thanks
User avatar
Junior Boarder

GK User
Tue Aug 28, 2012 7:11 am
Yes, of course there is a way to do it :)

Please open files:

html/com_content/category/blog_item.php
html/com_content/featured/default_item.php

and in the both files please replace:
Code: Select all
$this->item->created

to:
Code: Select all
$this->item->publish_up


in the following fragment:
Code: Select all
<?php if ($params->get('show_create_date')) : ?>
   <div class="gkArticleTools">
      <span class="gkCreateDateDay">
      <?php echo JHTML::_('date', $this->item->created, 'd'); ?>
      </span>
      <span class="gkCreateDateMonth">
      <?php echo JHTML::_('date',$this->item->created, 'F'); ?>
      </span>
   </div>
<?php endif; ?>
User avatar
Administrator

GK User
Tue Aug 28, 2012 10:16 am
Thanks for the prompt response - brilliant.

Sorry to be a dummy, but I have worked through my publichtml area and can find similarly named files, but not the same.

Could you tell me where they will be please?

Thanks again

Ian
User avatar
Junior Boarder

GK User
Tue Aug 28, 2012 10:32 am
The mentioned files:

html/com_content/category/blog_item.php
html/com_content/featured/default_item.php

are placed in the template directory: templates/gk_postnote/

so it is:

templates/gk_postnote/html/com_content/category/blog_item.php
templates/gk_postnote/html/com_content/featured/default_item.php
User avatar
Administrator

GK User
Wed Aug 29, 2012 4:31 pm
Hi, Dziudek

I think we may be confused. The publish_up parameter now means that the article displays the date it was published. What I was looking to do is to display the current date. By that I mean it will display 29 Aug today and 30 Aug tomorrow etc. - without me making any changes to the site.

Is this possible?

Thanks

Ian
User avatar
Junior Boarder

GK User
Wed Aug 29, 2012 4:49 pm
Wait a moment - you want to show always the current date in the date block? Or I misunderstand?
User avatar
Administrator

GK User
Wed Aug 29, 2012 5:00 pm
That is correct.

Ian
User avatar
Junior Boarder

GK User
Wed Aug 29, 2012 5:21 pm
So please try replace:
Code: Select all
$this->item->publish_up


with:
Code: Select all
time()
User avatar
Administrator

GK User
Wed Aug 29, 2012 7:58 pm
Sorted - thank you!

Ian
User avatar
Junior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.