Title: displaying the_date() using WP_Query
Last modified: August 19, 2016

---

# displaying the_date() using WP_Query

 *  Resolved [lamarant](https://wordpress.org/support/users/lamarant/)
 * (@lamarant)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/displaying-the_date-using-wp_query/)
 * I created a template for my blog home page that should simply list all of my 
   blog posts in chronological order. The list displays correctly but the problem
   is that the date displayed for every post is the same as the first one.
 * Here’s my code:
 * `
    <?php $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(‘showposts
   =5′.’&paged=’.$paged); ?> <?php while ($wp_query->have_posts()) : $wp_query->
   the_post(); ?> <div class=”BlogItem Sub”> <div class=”Meta”>
 *  <?php the_date(); ?>
    <!– { <?php the_category(‘: ‘); ?> } { <?php comments_number(‘
   0 Comments’, ‘1 Comment’, ‘% Comments’); ?> } –>
 *  </div>
    <div class=”DescWrapper”> <div class=”InnerPadding”> <div class=”Title”
   >” title=”Visit: <?php the_title(); ?>”><?php the_title(); ?></div> <div class
   =”Description”> <?php the_excerpt(); ?> </div> <div class=”More”> ” title=”Continue
   Reading: <?php the_title(); ?>”>Continue Reading » </div> </div> </div> </div
   >
 * <?php endwhile; ?>
    ‘
 * Here’s the link to the page:
    [http://www.leonamarant.com/blog/](http://www.leonamarant.com/blog/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/displaying-the_date-using-wp_query/#post-1119710)
 * Use the [template tag](http://codex.wordpress.org/Template_Tags), [the_time()](http://codex.wordpress.org/Template_Tags/the_time),
   instead of [the_date()](http://codex.wordpress.org/Template_Tags/the_date).
 * Related:
    [https://core.trac.wordpress.org/ticket/8532](https://core.trac.wordpress.org/ticket/8532)
 *  Thread Starter [lamarant](https://wordpress.org/support/users/lamarant/)
 * (@lamarant)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/displaying-the_date-using-wp_query/#post-1119961)
 * Still no luck.
 * Replaced the_date() with the_time() and still get the same results. The dates
   for the posts all show up as the first date.
 * What am I doing wrong here? Pulling my hair out.
 *  Thread Starter [lamarant](https://wordpress.org/support/users/lamarant/)
 * (@lamarant)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/displaying-the_date-using-wp_query/#post-1119962)
 * got it…my mistake.
 * I was replacing the text in the div after the DOM loaded using jQuery…and I was
   doing it completely wrong.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘displaying the_date() using WP_Query’ is closed to new replies.

## Tags

 * [the_date](https://wordpress.org/support/topic-tag/the_date/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [lamarant](https://wordpress.org/support/users/lamarant/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/displaying-the_date-using-wp_query/#post-1119962)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
