It's really hilarious but my the_date()
and the_time()
functions show the current date and time instead of the post's publication time, therefore at each refresh of the page, the time changes according to the actual time and date.
I am using these functions in a single template for a custom post in the loop, like so:
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); ?>
<h3> <?="Titre du projet"?> </h3>
<?php the_title(); ?>
<h3><?="Description"?></h3>
<?php the_content(); ?>
<p> <?php the_date(); ?> à <?php the_time(); ?>
<?php endwhile?>
<?php endif;?>
What's wrong? I tried other similar functions or get post date in the $post
object, but in their format, the date and time are inseparable. and I need them separately.
Thanks.