Answer the question
In order to leave comments, you need to log in
Why is the_date in the loop running only in the first wordpress iteration?
Why is the_date in the loop running only in the first wordpress iteration?
<?php
while ( have_posts() ) :
the_post();
?>
<div class="row article">
<div class="col-lg-4"><img class="img-responsive" src="<?php the_post_thumbnail_url(); ?>" alt="News"></div>
<div class="col desc">
<time><?php the_date( 'j F Y' ); ?></time>
<div class="author">Александр Иванов</div>
<a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php the_excerpt() ?>
<a class="more" href="<?php the_permalink(); ?>">Подробнее...</a>
</div>
</div>
<?php endwhile; ?>
Answer the question
In order to leave comments, you need to log in
Let's take a look at the_date function and see:
* Display or Retrieve the date the current post was written (once per date)
*
* Will only output the date if the current post's date is different from the
* previous one output.
*
* ie 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.
Why - I will not say, but you should always use . Always, alas, why - I can’t find it either, you can google about the reasons. echo get_the_date( 'j F Y' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question