In the template single.php I use 2 cycles
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="blogItemText"> <p class="date"><?php the_date(); ?></p> <h1 class="title"><?php the_title(); ?></h1> <?php the_content('', FALSE, ''); ?> </div> <?php endwhile; endif; wp_reset_query(); ?> and
<?php global $post; $args = array("category" => $blogId, "posts_per_page" => 3, "orderby" => "date"); $posts = get_posts( $args ); foreach( $posts as $post ){ setup_postdata($post); ?> <div class="blogItem"> <div class="dateBox"> <?php the_date("d M"); ?> </div> <div class="textBox"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a> </div> </div> <?php } wp_reset_postdata(); ?> The first one displays the current post, the second one displays 3 posts. The problem is that in the second cycle, the first post does not display the date.
When deleting <?php the_date(); ?> <?php the_date(); ?> From the first cycle, the date at the first post of the second cycle appears. The date disappears only at the first post and if it is output through the first cycle, i.e. When opening any other post there is no problem. Please help.