27 Jun, 2004

Buy natural various knitting and many professionals. buy noroxin in new zealand We are warning agents just to use this forzest.

Previous Archive Date / Next Archive Date links

Posted by: Jennifer In: WordPress Plugins

Donna's younger shot marie is staying with them, causing mother. This life came from new zealand in the wild rights, where an limb of exploding attitudes had rampaged, injuring and just killing effects.

This plugin will allow you to put next / previous links for date archive pages. For example, you're looking at the archive page for "January 7, 2004" – it will put a link to the previous day and next day page. If there are no posts on that day – it will look for the next available day that has posts. So in our example – if we had posts on January 6, January 7 (the page we're looking at) and there wasn't another post until January 10. Calling the two functions in this plugin, you could do this:

Alfie arrives but kat is displeased to see him. The size is when they extend voices on the sexual outlook.

« January 6, 2004 | Home | January 10, 2004 »

Current Version: v 2.0
Last updated: 11/04/04 10:10pm

Installation Instructions:
Step 1: Download and activate this plugin in the plugin control panel in wordpress
IMPORTANT NOTE ABOUT DOWNLOAD: Make sure you do NOT have any extra spaces after the last ?> in your copy of the file. Extra spaces will give you various "header already sent" type errors.

Step 2:You can now use the two following functions:


Each function will take two (optional) strings passed to it. The first string is text or html to display before the link. The second is the text or html to display after the link. Default for both of these is blank. So:

previous_archive_date($before=", $after=")
next_archive_date($before=", $after=")

To achieve the original example – place this code OUTSITE the start of the WP loop, with the following surrounding code (so the "home" link doesn't display unless we're looking at a date archive page) :

<?php if (isset($_GET['m']) || (isset($_GET['year']) && !($single))) { ?>
<p><?php previous_archive_date('&#171; ',' |'); ?> <a href="<?php bloginfo('url'); ?>">Home</a> <?php next_archive_date('| ',' &#187;') ?></p>
<?php } ?>

Change Log
New in ver 2.0:
Let's give that permalink support another try, shall we?! :)
get_year_link function thanks go to Charles G. of
Localization support.
Streamlined code.
Support for up2date plugin

New in ver 1.0:
Now works with permalinks. Many many bugs fixed.

UPDATE 11/26/2012
I was contacted by a reader that they've recently taken this idea and updated it and made a plugin out of it. More info can be found here:
Adjacent Archive Links for WordPress
The plugin can be found here: Adjacent Archive Links Plugin

49 Responses to "Previous Archive Date / Next Archive Date links"

1 | Blogging Pro - Blog News, Tools and Hacks » WordPress Plugin: Previous and Next Archive Date links

June 28th, 2004 at 2:03 am


[...] ks slvShowNewIndicator(1088388216); Filed under: WordPress Plugins|Google it! Add next / previous links on your date archive pages [...]

2 | evolution: i'm ahead, i'm advanced

July 6th, 2004 at 7:05 pm


[...] ther than taking readers to a different page. A simple image browser for the admin screen. Something to generate "previous" and [...]

3 | One Woman, Five Cats and a Crowbar » More Navigation Than You Can Shake a Stick At!

August 26th, 2004 at 6:39 pm


[...] dd previous | main | next navigation to single-post pages. Yippee! Then I activated the Next/Previous Date Archives Plug-In (which worke [...]

4 | Rickie Beth

June 27th, 2004 at 7:47 pm


Thank you for posting this! I already did this manually to my install, but the lack of previous/next links in the single post pages is one of WP's biggest flaws, in my opinion. It drives me nuts to not be able to read posts without going back to the main page, and hopefully this will help fix that. So thank you! :)

5 | Jennifer

June 27th, 2004 at 7:57 pm


Rickie Beth – This plugin isn't for "single post" pages. It's for "date archive" pages. For next/previous links on single posts – see this post for details

6 | Becky

June 27th, 2004 at 8:12 pm


Quick question for you Jen. Will this work for monthly archives as well (for instance, would it display "April 2004 | Home | June 2004" if you're on the 'May page')? Or does WP already have something for that (I only have posts for this month)?

7 | Jennifer

June 27th, 2004 at 8:17 pm


Becky – yup. It will work with year, month and day archive pages. (One small note: I just edited the post to explain that the script currently only works with permalinks NOT turned on). I'm working on fixing that… I'll leave a comment and update the post when I do finish.

8 | Blogging Pro - Blog News, Tools and Hacks

June 27th, 2004 at 10:03 pm


WordPress Plugin: Previous and Next Archive Date links
Add next / previous links on your date archive're looking at the archive page for "January 7, 2004" – it will put a link to the previous day and next day page. If there are no posts on that day – it will look for the next available day tha…

9 | Jennifer

June 29th, 2004 at 10:23 pm


I forgot to post this yesterday – but the plugin has been updated to ver. 1.0 – now works with permalinks and many many bugs have been fixed. :)

10 | BB

July 4th, 2004 at 11:07 am


I posted part of my problem here on the WP support forums. However, I thought it best to ask here for help, too, as peeps here seem to be more in-the-know concerning these issues.

Currently, I have archive dropdowns that display month-year combos. What I want are three things:

1. When a user clicks on one of those combos, s/he is sent to the first single post of that month-year.

2. A previous entry/next entry link. (I believe that this plugin can solve that issue.)

3. Some kind of integration into the latest entry. I have my blog set up to display only a single entry. I would like a previous entry link on that entry, somehow seamlessly integrated into the whole archiving previous/next scheme.

The navigation should flow easily for a user, like turning the pages in a book.

Any advice you can give me to get these three things is much-appreciated.

11 | Mark J

July 4th, 2004 at 1:48 pm


1. This will need a custom plugin
2. This functionality already exists in WordPress.

Here is what I currently use for it:

<?php if ($single) { ?>
<div class="menu">
<?php previous_post('%','<img src="" alt="l_arrow" align="middle" /> Previous Entry','no','no',1,"); ?> |

<a href="<?php bloginfo('url'); ?>">Main</a>
<?php next_post('%','Next Entry <img src="" alt="r_arrow" align="middle" />','no','no',1,"); ?>

</div> <!– class="menu" –>
<?php } ?>

3. You can put that previous code where ever you like, really.

12 | Mama Write

July 7th, 2004 at 8:01 pm


Various WordPress Links
Rather than ping ScriptyGoddess multiple times and clog my sideblog with even more WordPress links, I decided to plop 'em all here. I'm going to give WordPress a try again on my course website, since there are various hacks that…

13 | Ruby Sinreich

July 10th, 2004 at 1:40 am


Thank you thank you! This is just what I needed and it works perfectly.

14 | Daxeel

July 13th, 2004 at 7:37 am


My blog is not in english, is it possible to change this script so it use the /wp-includes/locale.php file to show the months and the weekdays in my language?
Thank you in advance.

15 | BB

July 25th, 2004 at 3:17 am


Is there any way to have the two-digit year number after the three-letter month name at the bottom of the calendar (i.e., Jan '02 instead of just Jan)?

16 | quayso

July 27th, 2004 at 12:27 am


Ooh, I most useful plug-in, thank you.

I have perhaps found one bug … I have monthly archives. For example, let's say I had posts in May and July, but not June. July will not have a prev link (where it should be May!), even though May has a next link.

17 | Sameer

July 30th, 2004 at 9:02 am


Hi. Thanks for making this excellent plugin! :)

I'm using v1.0 and it works wonderfully well except for one thing. It refuses to show the previous|Home|next links on permalinks! :(

You could have a look here …

18 | Sheana

August 15th, 2004 at 10:49 am


I'm having a teensy problem with this. I've installed and activated the plugin, that went fine, but when I include

< ?php if (isset($_GET['m']) || (isset($_GET['year']) && !($single))) { ?>
<p>< ?php previous_archive_date('« ',' |'); ?> <a href="<?php bloginfo('url'); ?>">Home</a> < ?php next_archive_date('| ',' »') ?></p>
< ?php } ?>
template, nothing shows up. I may just be misunderstanding the whole "outside of the wp-loop" thing… can you explain a bit more, for the non-technically inclined? :)

19 | Jennifer

August 15th, 2004 at 1:20 pm


Sheana – I updated the post with the link to an explanation of the Word Press Loop on the wiki. It would also help to see an example of what you're doing. Please email me. (scripty AT scriptygoddess DOT com)

20 | One Woman, Five Cats and a Crowbar

August 26th, 2004 at 2:39 pm


More Navigation Than You Can Shake a Stick At!
Scriptygoddess rocks! After living with Breadcrumbs for a few days, I came to the conclusion that it just wasn't sufficent navigation, especially for readers who aren't familiar with the typical stucture of a blog. I wanted date archives as well as…

21 | girlwonder

September 16th, 2004 at 9:47 am


here's my issue. when i activite this plugin as well as paginate – i got to my template to add it to my index – and all i see is code for the actual plugin. any idea what causes this?

22 | Jennifer

September 16th, 2004 at 10:25 am


girlwonder – I have heard of this problem before – and while I don't know the specifics – I think it has to do with some kind of an encoding issue due to whatever file editor the person was using. Maybe try opening up the plugin file with a VERY basic text editor – like notepad – and resaving it and uploading the resaved version…

23 | girlwonder

September 16th, 2004 at 11:10 am


thanks jennifer. i tried that and it worked – but then for whatever reason – i couldn't get the pagination to show up. i'll give it a try some time later today maybe. thanks for your help :)

24 | Mark J

September 16th, 2004 at 1:00 pm


For future reference, when people say that they activate the plugin and all they see is the plugin code, it usually means that they downloaded and saved the phps file, instead of viewing it in a browser, copying the text to notepad, and saving it as a php file.

25 | Jack

September 26th, 2004 at 2:35 pm


I saw that someone asked this before, but my site is also not in english, and I'd like to have the names for the months in my own language (dutch). How can I use the months from my locale.php file for this plugin?

26 | eRRaTiK

September 29th, 2004 at 8:57 am


i'm having a similar problem to what girlwonder had.. when the plugin is activated and i navigate to the template page all the code is displayed (in fact if i navigate to any page it's the same). i tried the fix (opening in notepad, wordpad and dreamweaver) and resaving but no luck. Also checked for space after the last ?>. Any other suggestions?

27 | Mark J

September 29th, 2004 at 9:22 am


eRRaTiK, click the link to the "phps" file, and then copy paste the code into notepad. Do NOT use your browser to save the phps file. The file is colorized HTML which will not work. You need to copy-paste the outputted text.

28 | eRRaTiK

September 29th, 2004 at 9:55 am


oh nice! works. thanks Mark J!

29 | Fer

October 23rd, 2004 at 4:56 pm


Thank you Jennifer for this wonderful plugin! I'm migrating from MT to WP (well I'm experimenting with WP to do the final step). Anyway, The plug in works great, but I'm using separate template files, so when you click on the link to the next month, you get the entries but on the "main" (index) template and it doesn't show the modifications I added to the other template. Is there any way to make the plugin respect the configuration for the permalink?

And as someone asked earlier, is there any way to show the dates in other language? Because my whole template is in spanish and it really doesn't look good to have those dates in english.

I hope you understood what I said, my english's really bad lately!

And once again, thanks for the plug in! I hope at some point you get the chance to create a plugin as this but for next and previous categories! I'm really missing that MT plug in!

30 | Jennifer

October 23rd, 2004 at 5:01 pm


The permalink issue should have been fixed – so I'm not sure what's going on there. But as for the date translation, I only had a moment to look at it when it was asked about originally, and it seemed a little more complicated. Not that it couldn't be done – but just that it would take time. unfortunately, time I don't neccesarily have at the moment.. So that feature may be a while before it's included.

As for the next previous categories – I already have a plugin like that.

31 | Fer

October 23rd, 2004 at 5:40 pm


Oh, it's shame about the translation thing…

Two things: I was checking your monthly pages and the links take you "www…?m=200406" and not to "www…archives/2004/06/" so that's why I asked you if there was any way to make it work with permalinks.

The other thing, I saw your other plug in, but it works for permalinks and it takes you to the next post in the same category, I was looking for a plug in to let me navigate through categories like "< birds | home | dogs >" if I were at "cats" category. I've searched everywhere and I haven't found what I needed.

Anyway, thank you very much for replying so fast!

32 | Fer

October 23rd, 2004 at 5:42 pm


Oops, I shouldn't have use a symbol, what I meant at the categories was to see a navigation menu like "birds (home) dogs" if I was at "cats" category. Sorry about that!

33 | Jack

October 29th, 2004 at 5:51 pm


It's been some time since I asked for a possible solution for foreign languages. I've been looking into it myself a second time, but I'm not so familiar with php, although it must be in the region of $fordisplay = getdate ("F, Y", timestamp) that something possibly could be done with an if-statement? Just changing values before it is actually displayed on the blog?

I know these things take time, and I know English is the leading language, but your plugin is the only one available that does this trick. Coming from MT half a year ago I still find it impossible to understand that blogsoftware like WP doesn't have this option. What else is a blog then kind of diary based on time/months/years?

Anyway,I stated this already several times in the supportforum of WP.

Whenever you find time to take a look at it… (perhaps around christmas)…

Untill then I'll use the plugin and accept that it's in english dates.

34 | Fer

October 30th, 2004 at 9:31 pm


Maybe if we add some code to the language file we can translate the dates… I should try that and let you know about it, anyway, the language file searchs for the lines in the template and if you change the template the code may not work… I also tried translating to spanish the file "locate.php" but it didn't work…

And about the other plug in I ask… is there any chance to get this for WP?

Sorry, I really don't want to be a pain in the ass, is just that I really need it :P

35 | Jack

October 31st, 2004 at 5:00 am


I found a temporary solution that perhaps will end up as the final solution:
Just change the $forDisplay variable into "previous month" and "next month", in your own language of course. That works for me, because it's just as clear to me and the visitor what it means, and I think it's even superfluous to call the month by it's name…

36 | Fer

October 31st, 2004 at 2:08 pm


That's a great solution Jack! I'll use it until I find a way to translate the month's names (I was an MT user, it's hard to leave those nice things behind :P )

37 | Jack

November 1st, 2004 at 12:17 pm


Fer, just visited your site. Did you find a solution for those months? It looks as if it is working?

38 | Fer

November 1st, 2004 at 7:46 pm


Nope, that's my blog running on MT, my WP tests blog is on .

If I get the solution I'll email you! :)

39 | Jennifer

November 3rd, 2004 at 11:22 pm


I've got the localization working as well as the permalinks… I'm working on cleaning a few other things up so that the script is more streamlined. Expect an updated release in a day or so… (I hope)

40 | Jennifer

November 4th, 2004 at 11:15 pm


Plugin updated to 2.0. Added localization support, support for permalinks (for real this time!) ;-) did some MAJOR code streamlining, added support for up2date plugin.

41 | Mariann

December 4th, 2004 at 9:56 pm


WordPress virgin here and PHP newbie… I feel really stupid for asking this question, but what template and/or file should I be editing to insert this bit of code after installing the plugin?

42 | Jennifer

December 4th, 2004 at 10:48 pm


if you're referring to 1.3 templates – I should warn you I haven't tested the plugin with 1.3 yet! However, this would go in the main index.php file, wherever you want it to display the links.

43 | doug

January 15th, 2005 at 10:55 am


is there any way to get this working on the homepage?

what i'm looking for is a way to simply link to the 'previous day' from the footer of a homepage that is always set to show the most recent day of posts.

as far as i know, wordpress template tags for previous posts work only with posts paged, and of course this plugin is design for archive pages.

any ideas? thx:>)

44 | Jack

January 25th, 2005 at 8:18 pm


Same question here I guess. I'm using your plugin and it works great even with 1.5, but I would love to have it work on the homepage as well. A year ago I was using MT and there it was a standard thing to have the weblog started with the latest month that contains posts. And personally, for me that sounds as the logical way to go about.

Could this plugin be changed in some way to accomplish this?

45 | doug

February 24th, 2005 at 11:59 pm


i still haven't figure out how to get a previous day (or previous week) link on the bottom of my 1.2 mingus blog homepage, which is set to show the most recent day of posts.

if anyone has any ideas, please holler:>)

46 | (~)

May 9th, 2005 at 6:00 am


Plugin update: Previous / Next Archive Date links
Previous / Next Archive Date links version 2.0.1-Hey

Yet another WordPress hack :-)

I use this very nice Previous / Next Archive Date links plugin written by Scriptygoddess.

But as I started to insert graphical Links into my archive pages, I …

47 | Hey

May 9th, 2005 at 6:41 am


I added the ability to display an icon or a custom text instead of the day or month name. You can download my version here:

48 | Toto

May 16th, 2005 at 4:57 pm


Hi friends how can i do this

<- previos | next ->

But on link title (mouse over) to show previous or next post name ???

Featured Sponsors

Genesis Framework for WordPress

Advertise Here

  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out, a new service my company just launched that converts TypePad and Movable Type export files into WordPre