Failure when 2 the_date tags
Hey, in the code for my front page I’m using 2 the_date tags, one to do some math and one to print out the day header and the results of that maths.. the code is below
//calculate when close
$daythen = 1085698800 - 86400;
$timealmostnow = the_date('d M Y','','',false);
$daynow = strtotime("$timealmostnow");
$almostday = ($daynow - $daythen);
$day = $almostday / 86400;
$day = floor($day);
<?php the_date("j M y","<h2> Day $day <span class=\"smaller\">",'</span></h2>');?>
(the point of the code is to work out how many days have passed since one specific day)
The problem is that I get the the day printing above every single entry, like it’s the_time. Any suggestions?
- The topic ‘Failure when 2 the_date tags’ is closed to new replies.