[resolved] displaying the_date() using WP_Query (4 posts)

  1. lamarant
    Posted 7 years ago #

    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:

    $wp_query= null;
    $wp_query = new WP_Query();
    <?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 class="DescWrapper">
    <div class="InnerPadding">
    <div class="Title">" title="Visit: <?php the_title(); ?>"><?php the_title(); ?></div>
    <div class="Description">
    <?php the_excerpt(); ?>
    <div class="More">
    " title="Continue Reading: <?php the_title(); ?>">Continue Reading »

    <?php endwhile; ?>

    Here's the link to the page:

  2. MichaelH
    Posted 7 years ago #

  3. lamarant
    Posted 7 years ago #

    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.

  4. lamarant
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic