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!
Responses
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….
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. :/
Murk
If you get a solution, do let me know!
Comment / Tip
. . . or leave a Tip
Danny Howard is 100% responsible for the content on this site, except some of it is stolen.
All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!
You can contact me via e-mail: dannyman@toldme.com
Most of http://dannyman.toldme.com/ is powered by WordPress.
If you're hip to RSS and whatnot, you can subscribe to this site.
These links are for dannyman: login AND backlinks