I'm using the following code at the bottom of my theme's node.tpl.php template to display the date last changed for each node...

<?php print "<br><span align='right'><font color='#ccc' size='-2'>Date last changed " . date("M jS, Y @ H:i:s T",$node->changed) . "</font></span>"; ?>

Now I just need to hide the display of the date modified only for nodes promoted on the front/home page. I am not a php expert. I would think an if/else conditional statement, wrapped around the above code in the node.tpl.php template would work, but don't know how to write it. I've found nothing in the forums or elsewhere on how to do this. Could someone clue me in please? Examples I can learn from are most appreciated. Thanks in advance!

Comments

yelvington’s picture

You should not be using the <font> tag, as it is not supported in current HTML.

Give your span a sane classname, such as "date_changed". Use CSS for all your styling, including color, size, alignment. If your homepage includes as "front" class (which is common), proper use of CSS selectors lets you simply "display:none" that item. It'll still be there in the HTML, but it will not be shown.