My site's archive page is echoing wrong Month name. Though the URL is 2012/11/
, it's echoing the month December 2012
.
I found nothing wrong with the code:
<?php
if ( is_day() ) :
printf( __( 'Daywise Posts: %s', 'theme-name' ), '<span id="font">' . "<b><i>". get_the_date() . "</b></i>" . '</span>' );
elseif ( is_month() ) :
printf( __( 'Month-wise Posts: %s', 'theme-name' ), '<span id="font">' . "<b><i>". get_the_date( _x( 'F Y', 'monthly archives date format', 'theme-name' ) ) . "</b></i>". '</span>' );
elseif ( is_year() ) :
printf( __( 'Year-wise Posts: %s', 'theme-name' ), '<span id="font">' . "<b><i>" . get_the_date( _x( 'Y', 'yearly archives date format', 'theme-name' ) ) . "</b></i>". '</span>' );
else :
_e( 'Archives', 'theme-name' );
endif;
?>
It's WordPress 3.4.2 here.
query_posts()
on that page, in a widget or some other code?query_posts()
, I've learned its problems from a stackexchange answer Wherever I needed a query, I usedWP_Query()
.Archive.php
.