WordPress.org

Ready to get started?Download WordPress

Forums

Trouble with displaying Post Dates (4 posts)

  1. bmoore2
    Member
    Posted 2 years ago #

    Howdy,

    I am currently having trouble displaying my posts date. Basically I want a page that will display all of my posts with their title, content, and date posted. I have everything working fine but the date. A note on this is that I created all of the posts on December 12th,2011 (yesterday). This is the date that is being displayed. However, I have gone into the posts table in the mysql database and altered the dates to be what I want. December 12 2011 is the date that is still being displayed on all of the posts even though the database is changed and the dashboard is also displaying correctly. Even when I create a new post today on the 13th 10/12/11 is still the date that is displaying!
    Another note: I am not sure that this would matter or not, but yesterday is also the day when I updated my wordpress to 3.2.1 from 2.6. which took place before I created any of these posts... not sure if that would effect it or not.

    Any thoughts would be greatly appreciated!

    My code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. bmoore2
    Member
    Posted 2 years ago #

    I apologize I put the wrong code in there this is for my single.php
    Here is what you want:

    <?php
    /*
    Template Name: blog_posts
    */
    
    ?>
     <?php
        // Get News
        $news_args = array(
    
            'order_by' => 'post_date',
            'order' => 'DESC',
    		'numberposts'=>1000
        );
    
        $articles = get_posts($news_args);
    ?>
    
    <?php include 'header.php' ?>
    <?php include 'top_logo.php' ?>
    <?php include 'top_nav.php' ?>
    
    <div style="margin-top: 20px;"></div>
    
    <table><tr>
    
        <td style="width:100%;  padding-right: 10px;" valign="top">
    
    		    <?php if ( $articles ): ?>
            <?php foreach ( $articles as $article ): ?>
            <div id="news_article_<?php echo $article->ID; ?>">
            <div><a style="color:blue;" class="title" href="<?php bloginfo( 'url' ) ?>/index.php/<?php echo $article->post_name ?>"><?php echo $article->post_title ?></a></div>
            <br />
    		<p style="font-size:12px; font-style:italic;"><?php  the_time('m/j/y g:i A') ?></p>
    		<p style="font-size:12px; font-style:italic;"><?php echo $article->ID;  ?></p>
            <div class="type_liner"><?php echo $article->post_content  ?>
            </div>
    
            <div style="margin-top: 20px;"></div>
            <?php endforeach; ?>
    
        <?php endif; ?>
    
        </td>
    
    </tr></table>
    <div style="margin-top: 20px;"></div>
    <?php include 'footer.php' ?>
  3. philowen
    Member
    Posted 2 years ago #

    I'm having a very similar problem with posting the modified date - using the_modified_date instead of the_time.

    Were you able to figure out a solution?

  4. philowen
    Member
    Posted 2 years ago #

    Also tried using the_modified_time and just the_time. None of them will show.

Topic Closed

This topic has been closed to new replies.

About this Topic