while (have_posts()) : the_post(); //some html <li class="icon-date"><?php the_date('Y-m-d');?></li> <li class="icon-time"><?php the_date('H:i:s');?></li>
With this code i am getting only date for first post - what is wrong?
I ran into the same problem several times, following changes worked for me in the past:
Looking at the Codex page there is a special note about
Also, If you want to control the format in wich
When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() or get_the_date() (since 3.0) with a date-specific format string. Use to add the date set in the admin interface.
For more information visit this page.
So according to the wordpress codex reference the correct code will be as following :