dannyman.toldme.com


Technical, WordPress

WordPress: Last Month / Next Month

I was tweaking the site navigation–and I welcome any feedback a reader may have–and I had to grab a plugin to allow me to link to next month / previous month / next year / previous year:

Next Archive Date / Previous Archive Date Plugin from scriptygoddess

I appreciate scriptygoddess’ work, as I’m using her paginate plugin as well. Unfortunately, the example on her site is kind of nasty. So, if someone is casting about on Google, here’s the code in my sidebar template:

    <?php if (is_year()): ?>
        <p><b>By Year</b><br />
        <?php previous_archive_date() ?>
            ...
        <?php next_archive_date() ?></p>
    <?php elseif (is_month()): ?>
        <p><b>Last Month</b><br />
        <?php previous_archive_date() ?>
        <p><b>Next Month</b><br />
        <?php next_archive_date() ?></p>
    <?php endif; ?>

Thanks for the code, Jennifer!

Read More

Next:
Previous:
Categories: Technical, WordPress
Possibly-Related Posts
Is CloudFlare Saving Me Money?
Experiment: April on $10/day
Updating WordPress: Upgrading php53 on CentOS
Latency Goggles for Linux
Oh, Netflix . . .
Amazon.com MP3 Downloader on 64-bit Ubuntu
isatapd: IPv6 on Ubuntu

  • http://www.murky.org/blg Murk

    I’ve been trying to get that going too (it seems like pretty basic functionality to me, and I’m amazed it’s not in WP) – but I can’t get it going, and it looks like it’s not on your pages either!

    Looking at your monthly archive page, it doesn’t seem to be there, well the text bits are….

  • http://dannyman.toldme.com/ dannyman

    Murk,

    Aye … I had to disable that plugin when it started doing bad things with memory consumption. I’ll find a new solution some day. :/

  • http://www.murky.org/blg Murk

    If you get a solution, do let me know!