• Resolved RogerUsh

    (@rogerush)


    I’m having trouble getting this to work. I used the code directly out of the codex and I can’t seem to make it function right.

    this is the code:


    <?php
    $arc_year = the_time('Y',FALSE);
    $arc_month = the_time('m',FALSE);
    ?>
    <a href="<?php echo get_month_link("$arc_year", "$arc_month"); ?>">archive
    for <?php the_time('F') ?> <?php the_time('Y') ?></a>

    For some reason the php defining the variables prints out on screen as “052005” before the link.

    Then when I click on the link it brings me to archives of current month and not the month of the post.

    http://www.imagebaker.com

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Change your first portion to this:

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

    get_the_time() was added in 1.5, and the echo parameter in the_time() was removed at that…time. Looks like I missed this one when updating the Codex awhile back. I’ll correct it.

    Thread Starter RogerUsh

    (@rogerush)

    Awesome! Perfect, worked like a charm.

    Thanks a ton.

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

The topic ‘Problem with get_month_link’ is closed to new replies.