display year in footer?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
toolman
Forum Members
Forum Members
Posts: 51
Joined: Wed Sep 12, 2007 5:10 pm

display year in footer?

Post by toolman »

Hi,

I am trying to display a date in the footer. I have tried:

Copyright ©

but it doesn't work. Is there another date tag I can use?

Thanks.
User avatar
MikeTroop74
Forum Members
Forum Members
Posts: 65
Joined: Thu Oct 14, 2010 6:58 pm

Re: display year in footer?

Post by MikeTroop74 »

I found this in the template I am using.

Make a new UDT and name it "custom_copyright"

Put this in the *Code area:

//set start to date your site was published
$startCopyRight='2010';

// check if start year is this year
if(date('Y') == $startCopyRight){
// it was, just print this year
    echo $startCopyRight;
}else{
// it wasnt, print startyear and this year delimited with a dash
    echo $startCopyRight.'-'. date('Y');
}

Now call the UDT in your template where you want the year to appear. This is how I am using it:

Copyright © {custom_copyright} Troop 74. All Rights Reserved.
Might not be exactly what you are looking for but hope that helps.
Post Reply

Return to “Layout and Design (CSS & HTML)”