I ran into the same problem several times, following changes worked for me in the past:
1 2 3 4 | while (have_posts()) : the_post(); //some html <li class="icon-date"><?php echo get_the_date( 'Y-m-d' ); ?></li> <li class="icon-time"><?php the_time( 'H:i:s' ); ?></li> |
Instead of the_date()
, use get_the_date()
. The only thing to be aware of, is that values returned by get_the_date() have to be echoed.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.