break up date variable
-
I’m trying to format each piece of the date into seperate spans/divs, as such:
<span>5</span> <div>Jan</div> <div>2009</div>
Have never used php, but am vaguely familiar with programming in Javascript, etc. I tried this, didn’t work:
<?php $date = "</span> <div class=\"month\">"; $month = "</div> <div class=\"year\">"; the_date('j' + $date + 'M' + $month + 'Y', '<h2><span class="date">', '</div></h2>'); ?>
The variables were ignored. The end result was
<h2><span class="date">5 Jan 2009</div></h2>
Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘break up date variable’ is closed to new replies.