• Using get_calendar in my new layout provided a challenge. Because I couldn’t get the caption (the month name) to look the way I wanted it to look in IE, I decided to echo the current month and year using the following bit of code:

    <?php
    $arc_year = get_the_time('Y');
    $arc_month = get_the_time('F');
    ?>
    <?php echo $arc_month; ?> <?php echo $arc_year; ?>

    And using display: none for the caption. This works like a charm on archive pages and the index page, both that bit of code and the calendar displaying matching months. The problem is that when I click “previous posts” on the index page and the top post is not from the current month, that bit of code up there displays the month in which the top post on that page was posted, but the calendar doesn’t match anymore. I hope that makes sense and that someone can come up with a solution for this, if it’s not too complicated. Thanks in advance.

  • The topic ‘Echo current month and year – problem’ is closed to new replies.