My current code in functions.php:
echo '<div class="post_date">'.the_time('d', '<div class="month">', '</div>').the_time('F', '<div class="day">', '</div>').the_time('Y', '<div class="year">', '</div>').'</div>';
But it only returns:
20April2011
No html around it, why? how can I fix this?
Please see this documentation for the usage about
the_time()
. You are not supposed to add html inside the parameter ofthe_time()
. (edit: useget_the_time()
with in string concatenation)To solve this, try this code:
edit: corrected to the use of
get_the_time()