Forums

calling the calendar month... (4 posts)

  1. annam
    Member
    Posted 3 years ago #

    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.

  2. Kafkaesqui
    Moderator
    Posted 3 years ago #

    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;
    }
    ?>

  3. annam
    Member
    Posted 3 years ago #

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

  4. Kafkaesqui
    Moderator
    Posted 3 years ago #

    "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)?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.