• I was wondering how I’d go about calling the calendar month outside of the template page and in my footer template instead. I can figure out how to remove it (not hard work) but I just can’t figure out how to call it outside of the template page. Hope thats clear :/

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not sure what you’re asking for. You wish to display just the name of the month in the footer when on an archive query page? If so, this bit of code will do that:

    <?php
    if( is_archive() ) {
    global $m, $month, $monthnum;
    if($monthnum) {
    $monthname = $month[zeroise($monthnum, 2)];
    } else {
    $monthname = $month[substr($m, 4, 2)];
    }
    echo $monthname;
    }
    ?>

    Thread Starter annam

    (@annam)

    Not on an archive page, just the regular theme footer.

    Not on an archive page, just the regular theme footer.

    I’m sorry but that doesn’t clarify matters.

    You want it to display in the footer, I get that, but *when* do you want it to display? You said you want the calendar month, but does that mean the *current* month, or the month that appears on the WordPress calendar (which effectively means in archives)?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘calling the calendar month…’ is closed to new replies.