problem with publish date not always appearing [duplicate]

From the the_date() documentation:

Will only output the date if the current post’s date is different from the previous one output.

i.e. Only one date listing will show per day worth of posts shown in the loop, even if the function is called several times for each post.

[Emphasis mine]

You’re almost certainly looking for get_the_date(), which you would use like this:

<?php echo get_the_date(); ?>