• Resolved snakeye

    (@snakeye)


    I’m trying to get the date to display on multiple posts on the same day. I haven’t been able to find much help on PHP (as I think that’s where my problem lies). Right now, if I have 2 posts on the same day, I get the second post having a blank date. I’ve used the Travelogue theme as a base and modified it from there. Here is the current code in index.php for the date stuff:

    <div class="post">
       <div class="post_cal">
       <?php $postraw = the_date('D, j, M, y', '', '',FALSE);
        $postdate = explode(', ', $postraw);?>
       <div class="dayname"><?php echo $postdate[0]; ?></div>
       <div class="daynum"><?php echo $postdate[1]; ?></div>
       <div class="month"><?php echo $postdate[2]; ?> '
       <?php echo $postdate[3]; ?></div>
       <div class="year">

    Is there anyway I can mod this to post the date on all posts?

Viewing 1 replies (of 1 total)
  • Thread Starter snakeye

    (@snakeye)

    I got it now. I R<sup>2</sup> it with this code:

    <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post">
    				<div class="post_cal">
    					<?php
    						$postraw = the_date('D, j, M, y', '', '', FALSE);
    						if ($postraw != '') {
    							$postdate = explode(', ', $postraw);
    						} ?>
    					<div class="dayname"><?php echo $postdate[0]; ?></div>
    					<div class="daynum"><?php echo $postdate[1]; ?></div>
    						<div class="month"><?php echo $postdate[2]; ?> '<?php echo $postdate[3]; ?></div>
    						<div class="year">
Viewing 1 replies (of 1 total)
  • The topic ‘Date won’t display on same-day posts’ is closed to new replies.