WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. lamarant
    Member
    Posted 5 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:

    `
    <?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/

  2. MichaelH
    Member
    Posted 5 years ago #

  3. lamarant
    Member
    Posted 5 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
    Member
    Posted 5 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