• On my archive.php page, this code:

    <?php if ( is_day() ) : ?> <!-- if the daily archive is loaded -->
    			<?php printf( __( 'Daily Archives'), get_the_date( $d ) ); ?>
    		<?php elseif ( is_month() ) : ?> <!-- if the montly archive is loaded -->
    			<?php printf( __( 'Monthly Archives' ), get_the_date('F Y') ); ?>
    		<?php elseif ( is_year() ) : ?> <!-- if the yearly archive is loaded -->
    			<?php printf( __( 'Yearly Archives' ), get_the_date('Y') ); ?>
    		<?php else : ?> <!-- if anything else is loaded, ex. if the tags or categories template is missing this page will load -->
    			Blog Archives
    		<?php endif; ?>

    is displaying the date from the most recent post. So, if the daily archives come up, it always just shows the date from the most recent post. If a monthly archive is pulled up, it shows the month from the most recent post, no matter which month is clicked. I also tried using the_time and got the same results. any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wrong date displayed with get_the_date’ is closed to new replies.