• This doesn’t seem to work.

    I want to be able to have the months where articles have been posted displayed as a list and as a link to articles that were written in that month.

Viewing 5 replies - 1 through 5 (of 5 total)
  • It works, just not as the wiki(s) explain–which ticks me off, because I thought I checked this tag when editing its entry on Codex. However, that’s my problem…

    To display the url to the *current* month’s archive of posts, use it like so:

    <?php get_month_link('',''); ?>

    To get the url to a specific year/month archive, specify that year and month:

    <?php get_month_link(2004, 12); ?>

    Finally, for the url to the archive of a post’s year/month, some additional PHP is needed:

    <?php
    $my_year = the_time('Y',FALSE);
    $my_month = the_time('m',FALSE);
    echo get_month_link("$my_year", "$my_month");
    ?>

    This would have to be used within The Loop. Now, off to correct some wiki pages…

    Thread Starter nicktoye

    (@nicktoye)

    Well I use this tag

    <?php get_archives() ?>

    and it works ok.

    While i’m on I want to know if I can show a list of the recent posts, but also show the author and the date it was published.

    Currently I use this tag

    <?php get_recent_posts();?>

    Thread Starter nicktoye

    (@nicktoye)

    get_recent_posts() is part of the Recent Posts plugin. You’d have to hack the code of that plugin to get it to list what you want.

    Another option is to use the get_posts() tag in a modified post loop.

    Thread Starter nicktoye

    (@nicktoye)

    OK, is it difficult to do. I want it to display the author and the date, i’m quite new at php, so I presume I would have to open the recent-post.php page in Dreamweaver and change the code to include the author and the date.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get_month_link’ is closed to new replies.