A Different Monthly Archive Script

This WordPress plugin displays a “different” monthly archive in the format of a table, instead of the standard unordered-list that many sites use. To see it in action, look right a little. It’’s the thing I use on my site.

Download

nicearchive.php is available for download now. To install it, pop it inside the ”plugins” subdirectory of wp-content (and rename it to nicearchive.php). To activate it, go to “Plugins” in the admin area and click ”activate”. It really is that simple.

Usage

To use, add in a php call to < ?php get_niceArchive(); ?> somewhere in your template (probably the sidebar). There are, however, some optional parameters:

  1. $order default: DESC. Used in the ordering of the table. Use “DESC” to order from highest year to lowest (i.e from today backwards), otherwise “ASC” (i.e from the past forward until today). Mine is DESC, so it starts at 2005 and goes backwards to 2oo4, 2003, etc.
  2. $tableClass default: datearc. Used for the CSS class for the whole table.
  3. $tableClassAlt default: datearcAlt. CSS class used for one part of the alternating backgrounds (1st and 3rd column).
  4. $tableClassAlt2 default: datearcAlt2. CSS class used for second part of the alternating backgrounds (2nd and 4th column).

Sample CSS

The CSS below is taken from this site’’s stylesheet:


.datearcAlt2 , .datearcAlt {
border-bottom: 1px solid #DCDCDC;
font-size: 0.86em;
padding: 2px;
width: 25%;
text-transform: lowercase;
}
.datearcAlt2 {
background: #E7E7E7;
}
.datearcAlt {
background: #F7F7F7;
}
.datearc {
border: 0px none;
padding: 0;
margin-left: auto;
margin-right: auto;
width: 165px;
}

This creates a basic alternating column colour table. You can write your own CSS for the “th” element, which is used when displaying the years.

About

I used to use this on my old MovableType weblog but converted it when I changed over to WordPress. I don”t, however, own the script - it was originally featured on RoyalTS. As for a license, I”m not really that sure.

Version History

Version 1.4 (4th March 2006): The script is now multilingual :). It displays the 3 letter months based upon your Wordpress locale.
Version 1.3 (5th January 2006): The script now gives a link to the ”proper” permalink page (using your defined permalink structure) for each month instead of to the main wordpress index.php. I have also been told that this script is compatible with Wordpress 2.0.
Version 1.2.2 (21 September 2005): Added small bugfix to add &nbsp; to all empty cells instead of a blank space, and also added feature to only pad out incomplete years to the nearest multiple of 4, so a year with only one month will not show 12 cells.
Version 1.2.1 (17 May 2005): Added a hard-return after the “<?php” at the start of the code to fix some ”headers already sent” errors being displayed after script activation.
Version 1.2 (14 May 2005): Added some comments as to how the array $monthlyarchive is populated and also fixed a small bug that did not create extra table cells if there was a row that was not currently full.
Version 1.1 (15 Apr 2005): Added the ability to choose the sort order of the table.
Version 1.0 (14 Apr 2005): First version. Added (simple) parameters for setting CSS classes used in the table.

95 Comments »

1. comment by Kafkaesqu?ɬ?, on April 15, 2005 at 7:52 pm:

I really, really like this. Sort of an archive in compressed calendar format.

Suggestion: switch to DESC order, as I suspect most will want to list their more recent archives first. Better yet, provide it as a parameter.

2. comment by Rob, on April 15, 2005 at 9:20 pm:

Thanks for the ideas. I added some CSS and created an order parameter to choose ASCending or DESCending.

Rob

3. comment by Tach, on April 16, 2005 at 12:04 pm:

I love it. I was always jealous of it and my frantic searches for something similar came up empty. Nice job Rob.

4. comment by baxter, on April 26, 2005 at 9:16 am:

Nice work Rob :)

5. comment by Sean, on May 8, 2005 at 8:41 am:

Great plugin. It might be helpful to add comments on where you would change the code to customize the url produced for those not that familar with php. Thanks!

6. comment by Will, on May 17, 2005 at 1:52 pm:

Very nice work. I like this plugin.

I’m not sure if anyone else has experienced this, but when I first activated the plugin, the admin screen displayed several errors at the top of the page stating that the headers were already sent.

The fix is simple - at the top of the file, put a hard return between the “

7. comment by Will, on May 17, 2005 at 2:32 pm:

The fix is simple - at the top of the file, put a hard return between the “>?php” and the “/*”.

8. comment by Rob, on May 17, 2005 at 2:49 pm:

Hi Will - I’ve not experienced the problem but I have added said hard-return to the file anyway.

Cheers :)

Rob

9. comment by tom, on May 23, 2005 at 9:29 pm:

Rob, I’m getting:
“Parse error: parse error, unexpected T_VARIABLE in /home/citixen/public_html/wp-content/plugins/nicearchive.php on line 14″

Installed in Sidebar.php, read through your Comments, eyeballed your code-nothing seems obviously amiss.

Is T_VARIABLE referring to the database?

thanks!

10. comment by Rob, on May 23, 2005 at 9:56 pm:

Hi Tom,

I’ve downloaded the code and (re)installed it on my blog and it works ok for me so one idea would be to redownload it and start again. I’ve changed the way the file is downloaded (the link is now to a text file) as it is easier to use “save as” on it.

What version of WordPress are you using? I’m unsure about whether it would in WordPress 1.2 but it’s worked fine in 1.5 and 1.5.1.

T_VARIABLE is a PHP error that isn’t related to the database but it can have many causes - i’m not sure the cause of it this time round!

Rob

11. comment by tom, on May 24, 2005 at 12:49 am:

Thanks for the quick response, Rob! Loads up fine now. This thing is sweet!

One question (and I haven’t yet spent time on it myself), can one suppress the display of rows for months with no posts available? In my case, I started the blog in the last months of 2003, and it shows squashed rows for the prior part of that year.

It’s no big deal, just thought I’d ask. Thanks for providing this plugin!

Cheers!

12. comment by Rob, on May 24, 2005 at 9:32 am:

Hey Tom,

Pleased you got it working!

That’s something I thought would be a problem but I’ve never ran into it. I’ll have a look into fixing it (and something else that is slightly related to that) in the next few days.

Rob

13. comment by richard, on June 13, 2005 at 5:49 am:

I did a very simple replacement of every “4″ for a “3″ and got what I was looking for; I wanted to keep my archives a bit narrow. Side effect with your suggested CSS was a checkerboard effect, which was nice.

Here I was going to write my own; thank you google…

14. comment by Andy, on September 21, 2005 at 10:05 pm:

Where do I put your CSS code? I tried pasting it at the bottom of my stylesheet file to look like this:

/*begin nicearchive.php stylesheet*/

.datearcAlt2 , .datearcAlt {
border-bottom: 1px solid #DCDCDC;
font-size: 0.86em;
padding: 2px;
width: 25%;
text-transform: lowercase;
}
.datearcAlt2 {
background: #E7E7E7;
}
.datearcAlt {
background: #F7F7F7;
}
.datearc {
border: 0px none;
padding: 0;
margin-left: auto;
margin-right: auto;
width: 165px;
}

/*end nicearchive.php stylesheet*/

Sorry for the noobish question. I woud like to use your archive on my blog.

Thanks

15. comment by Rob, on September 21, 2005 at 10:08 pm:

Yep anywere in the template stylesheet you use for your theme :). That looks like it’s correct!

16. comment by Rizwan, on October 19, 2005 at 2:08 am:

Implemented it for a friend. I really like it myself, and so does he. Great work :cool: really appreciate it. Thanks :smile:

17. comment by Dmitri Von Klein, on December 25, 2005 at 8:11 pm:

Excellent plugin, using it.

Few suggestions: permalinks and linking to year archives.

Thank you!

[...] Nice Archives - this makes the archives list prettier [...]

19. comment by Keith, on January 1, 2006 at 7:22 pm:

Is there a way to exclude particular categories from the archives with this plugin?

20. pingback by Marcy Prochaska: Hammered Dulcimer » Blog Archive » Monthly Archives, on January 11, 2006 at 8:30 pm:

[...] I found this great plug-in today that displays monthly archives in a calendar format. Much nicer to look at than the default list. [...]

21. comment by Marcy, on January 11, 2006 at 8:38 pm:

I love this plugin. I had been hoping someone would write a plugin that puts each year’s monthly archives in a drop-down menu, but this is even nicer to look at.

Is there anything I should do to make sure that the information is accessible to all users? I understand tables can cause problems for some folks.

22. pingback by Simple Inside » Cool way to Display Archives, on January 13, 2006 at 5:06 pm:

[...] Posted by Sadish on Jan 13 2006 | Tagged as: Side Notes There is this plugin, to display the archives in a calendar kind of format. Check it out on this website. [...]

23. comment by Johan, on January 25, 2006 at 7:59 pm:

Nice! Is there some easy way to change month names to languages other than English?

[...] http://www.oneofthosedays.org.uk/projects/plugin-archivesThis WordPress plugin displays a “different” monthly archive in the format of a table, instead of the standard unordered-list that many sites use. To see it in action, look right a little. It’s the thing I use on my site. [...]

25. pingback by www.jammo.net » interesting plugins that still work on WordPress 2.0, on February 10, 2006 at 2:28 am:

[...] A Different Monthly Archive Script - displays a “different” monthly archive in the format of a table, instead of the standard unordered-list that many sites use. http://www.oneofthosedays.org.uk/projects/plugin-archives [...]

26. comment by Ilona, on February 25, 2006 at 6:38 pm:

A very nice plugin and so easy to use. I like it very much!!! But I?Ǭ¥ve the same question like Johan at 23.: I?Ǭ¥d like to display the month names in German, is there a way to do that?
Thanks in advance for your help!

27. comment by Rob, on February 25, 2006 at 9:10 pm:

Hi Ilona,

I’ve never used a localised version of WordPress but I will see what I can do with regard to translating it to work with different languages.

Thanks :)

28. comment by Ilona, on February 25, 2006 at 9:59 pm:

Oh, thank you! I?Ǭ¥m looking forward to your solution. :-)

29. comment by Brad, on February 28, 2006 at 4:47 am:

Two things: 1. Can this be translated to output lists rather than tables? 2. Can this be made to display all the months of the year despite whether or not there were posts during that month?

30. comment by Rob, on March 4, 2006 at 11:03 pm:

Hi Brad,

It can’t output lists i’m afraid. Wordpress has some template tags to give lists of old posts so those should be okay, unless I misunderstand what you are after.

As for displaying all months of the year, I will look at that. It is something I’ve wanted to implement but have not had the drive to do it.

31. comment by AK, on March 7, 2006 at 9:22 am:

Thanks for the plugin. After some mods to the css the archives looks nice.

32. pingback by Interesting News Posts, on March 9, 2006 at 11:15 pm:

[...] [...]

33. comment by Luc, on March 11, 2006 at 11:42 am:

Hello,
I used successfully your script for a very long time but suddently with the brand new 2.0.2 WP release it throuws an error :

#
# Warning: Cannot modify header information - headers already sent by (output started at /home.2/foo/bar/blog/wp-content/plugins/nicearchive.php:1) in /home.2/foo/bar/blog/wp-rss2.php on line 8

Here I collected the error message from wp-rss2 but a lot of Wp files send the same eror, even admin when activating or deactivating a plug in

Luc

34. pingback by Administrator, on March 11, 2006 at 3:31 pm:

[...] [...]

35. pingback by Favorite WordPress Plugins : Business Blog Consulting, on March 15, 2006 at 3:14 am:

[...] A Different Monthly Archive - a pretty way to display links to archives by month [...]

36. comment by Drew, on March 17, 2006 at 4:09 pm:

What would be lovely - if I may be so bold to say - is an option to have a different number of colums - just a thought.

Now to tinker this thing into my theme, thanks.

37. comment by Donna, on March 17, 2006 at 11:29 pm:

I have a VERY stupid question. Do I right click the link to the plugin? If I do that, I save an HTML file, and when I rename the file, it still thinks it’s an html file.

I’m not sure how to use this plugin :)

38. comment by Merkal, on March 18, 2006 at 7:32 pm:

Great plugin, I’ve been wanting a good archive plugin that sorted by year/ month. nicearchive fullfills that want and more!

39. pingback by Streetrat » Blog Archive » Nice Archive Plugin, on March 18, 2006 at 7:40 pm:

[...] Installed a plugin to display the blogs archive. I didn’t like the old plugin very much but haven found (read: was to lazy to look for) a good alternate. Behold A Different Monthly Archive Script Must have for any WordPress powered weblog. [...]

40. comment by Andrea, on March 19, 2006 at 5:54 pm:

Whee — thanks a lot! I’ve wanted a plugin like this ever since I started to use WordPress :)

It works very well with WordPress 2.0.2. I’m using a highly customised version of the White as Milk theme, and the only thing I changed in the CSS is the font size and the “convert to lowercase”.

41. pingback by Blogalistic » Different monthly archives, on March 20, 2006 at 5:19 pm:

[...] A WordPress plugin to create monthly sidebar archives in a well-organised table. [...]

42. comment by Rob, on March 22, 2006 at 10:58 pm:

Donna - if you right click the link at the top that says “nicearchive.php”, click “save as” and then save it as “nicearchive.php” then you should be able to upload it to your wp-content/plugins directory on your server and it’ll show up in the plugins section of your administration panel.

It shouldn’t show as an HTML file! This may happen if you load the text file and then go to the “Save as..” menu item inside the File menu of your browser. It might try and download it as a web site rather than a text file.

43. comment by Basil Vandegriend, on April 3, 2006 at 4:30 pm:

It looks great. The only thing I miss is seeing the # of posts available in each month, like the default WordPress archives shows.

44. comment by svl, on April 11, 2006 at 9:21 pm:

Hi Rob!
Very nice work. I like this plugin. Thank you!

45. pingback by sosa0sa.com » Blog Archive » 2006.04.24 web, on April 26, 2006 at 2:06 pm:

[...] A different Monthly Archive script  : ?¨?í‚Ä??´‚Ä?¬§?´¬•¬?(?) Monthly archive [...]

[...] A Different Monthly Archive - a pretty way to display links to archives by month [...]

47. comment by biggest, on September 19, 2006 at 10:07 pm:

biggest clit

48. pingback by Favorite WordPress Plugins, on September 21, 2006 at 6:42 am:

[...] A Different Monthly Archive - a pretty way to display links to archives by month [...]

49. comment by James in Cala Dor Palma de Mallorca, on September 24, 2006 at 4:09 pm:

Hi, I’ve found version 1.4 works great on one of my blogs! Thanks!

50. pingback by richard’s ramblings… » Credit Where Credit is Due…, on October 11, 2006 at 7:42 pm:

[...] A Different Monthly Archive Script — I like the new format of the sidebar calendar that this plug-in provides more than the standard one. [...]

51. pingback by leonardofaria.net // weblab // webstandards, flash, webdesign e macintosh, on October 21, 2006 at 10:16 pm:

[...] Wordpress ?© unanimidade em solu?ß?£o para blog. H?° uns tr?™s anos, quando comecei minha vida blogger, eu mesmo escrevia um pequeno gerenciador de not??cias, mas isso n?£o se mostrou t?£o eficiente. Depois disso, adotei o AJ-Fork, mas esse tamb?©m n?£o se mostrou t?£o eficiente. Adotei o Wordpress e agora relato alguns plugins bastantes interessantes, que uso aqui, ou na extranet da empresa (sim, aonde trabalho estamos desenvolvendo uma extranet). Browser Sniff: exibe informa?ß?µes de browser e sistema operacional de quem comenta. A Different Monthly Archive Script: exibe o arquivo de posts em forma de tabela. PHP Highlighter: colore a sintaxe de scripts PHP Quote from TXT: Frases aleat??rias de um TXT no blog Subscribe to comments: Adiciona um campo no formul?°rio de coment?°rios que permite acompanhar as discuss?µes por email IP2Nation: Exibe o pa??s de quem comenta Weighted Categories: Exibe as categorias do blog em formato tagcloud, ou seja, categorias com mais posts em maior tamanho de fonte Angsuman‚Äôs Authenticated: Restringe o acesso ao WordPress apenas a usu?°rios cadastrados. Live Search: busca estilo Google Suggest AdSense-Deluxe: plugin para melhor gerenciamento do Adsense [...]

52. pingback by Marigold » Archiv » Krle?Ö¬° WordPress, on October 31, 2006 at 8:51 pm:

[...] different monthly archive [...]

53. comment by keepreadingus, on November 6, 2006 at 10:28 am:

Hi,

Thank you for the gr8 plugin. i am using it on http://www.keepreadingus.com
It is working perfectly fine in wp v2.0.5

I wonder if you have something similar oen for archives by category also… any nicer way of displaying the archives.

54. pingback by Krle?Ö¬° WordPress » Marigold.cz, on November 9, 2006 at 12:09 pm:

[...] different monthly archive [...]

55. pingback by Favorite WordPress Plugins « Webdevelopment Technologies, on November 28, 2006 at 9:14 am:

[...] A Different Monthly Archive - a pretty way to display links to archives by month [...]

56. comment by Fan of Don Lapre, on December 6, 2006 at 11:18 pm:

Got It…And Love it!!!! Thanks for the the great Plug In!!!

Fan of Don Lapre
http://www.callvirgil.com
webmaster@callvirgil.com

57. pingback by SoloWoo ?•¬???®?í¬°?ß‚Ä?¬©?®¬™?æ » Funple - WPG2 Theme, on December 18, 2006 at 3:47 am:

[...] A Different Monthly Archive [...]

58. comment by Mattg, on January 13, 2007 at 10:52 am:

Works great. Nice plugin.

59. comment by kateshortforbob, on January 19, 2007 at 1:33 pm:

Thanks for this - a much more attractive archive, & very easy to set up.

60. comment by simon, on February 8, 2007 at 6:50 pm:

Ive always been a fan of this plugin, it makes your blogger much happier. Thanks

61. comment by simon, on February 10, 2007 at 1:05 am:

yes. thanks it works for me too

62. comment by tavla, on February 11, 2007 at 1:32 pm:

This is very nice!

63. comment by Rob - web page tools, on February 21, 2007 at 9:43 pm:

I found using Wordpress to design my web sites a great time saver and with plugins for automatic sitemap generation and SEO optimisation and easy changing of themes its such a web design time saver. If fact i just made a template from the theme i’m currently using and after veiwing the souce code i just saved as html and with a bit of copy and pasting moved all the content on my older html pages to the new template now my older pages all look the same as the blog template. On a new site this isnt a problem but this one has been around a while before i used Wordpress. Still have a load of article pages to move over but i should be able to automate some of it with a few block text replacer programs i have.

64. comment by Willl, on February 28, 2007 at 6:13 pm:

Thank you this solves one of the issues that i have with worpress.

William

65. comment by Steve, on March 8, 2007 at 7:49 am:

Thanks - very helpful.

66. comment by MJ99 PHP Scripts, on March 13, 2007 at 3:16 am:

Works! Very useful. Thanks.

67. comment by MJ99 PHP Scripts, on March 13, 2007 at 8:43 pm:

Very good. Thanks.

68. comment by Paul, on March 17, 2007 at 7:12 pm:

Found via AdesBlog.com and now used on mine @ blog.henman.ca - very neat; thanks.

69. comment by depp4u, on March 25, 2007 at 6:51 am:

can’t seem to get the CSS to work correctly.
doesn’t want to create tables.
please help. newbie workin’ hard.
I am using tiga theme, is that the problem?

70. comment by Martin, on March 27, 2007 at 10:45 pm:

Hello, i just want to say Thank you for you great “job” - very good -thx. Martin from http://www.ausmusterung.biz

71. comment by Backlinks, on April 13, 2007 at 12:08 am:

Hello,
it?Ǭ¥s very go job. Thank you.

Horst from http://www.dejavue-gmbh.de

72. comment by bgedod, on June 15, 2007 at 3:52 pm:

We all that all the evangeline lilly nude hair should be more.

73. comment by ljagwyhxogy, on June 24, 2007 at 11:21 am:

Come here, moms anal adventure maria jim, we have to cara asked what i asked. The mild, then.

74. pingback by Upgrade a Wordpress 2.2.1 at InvisibleVoice /.blog/, on June 26, 2007 at 2:41 pm:

[...] installare Executable PHP Widgets per ripristinare la visualizzazione A Different Monthly Archive Script del mio archivio post nella sidebar [...]

75. comment by tcobujob, on July 6, 2007 at 5:50 am:

Chapter aiko tanaka asian hot import model 16 what was one now that iron john, floyd.

76. comment by evujehg, on July 12, 2007 at 5:20 pm:

Behind the ashes open pussy video and use it should be a.

77. comment by cunt, on August 3, 2007 at 2:44 am:

It’s a snarl and gestured to cunts dripping crawl. At me, the student body was.

78. comment by jijimokdigeq, on August 6, 2007 at 5:09 pm:

latins women I. - - except for him. Svinjar takes care of kahlan.

[...] Plug-in:?Ǭ† A Different Monthly Archive Script Version: 1.4 Author :?Ǭ† Rob Watkins Desc:?Ǭ† This WordPress plugin displays a ?¢‚Ǩ?ìdifferent?¢‚Ǩ? monthly archive in the format of a table, instead of the standard unordered-list that many sites use. [...]

80. pingback by Blog Makeover | philomyth.us, on September 18, 2007 at 4:07 am:

[...] A Different Monthly Archive Script: posting calendar [...]

81. comment by bratyfly, on September 25, 2007 at 9:40 pm:

hi, great plugin. but im just wondering why am i getting year 0 at the bottom of the list. i hope you could help me. thanks

82. comment by breasts, on October 12, 2007 at 5:26 am:

You didn t take her swim suit top whichremained on an entrance bare breasts into the top.

83. comment by upskirt, on October 13, 2007 at 1:01 pm:

Her hand. Tom was pretty cool when at that she couldn pantyhose pics t.

84. comment by stories, on November 1, 2007 at 2:39 pm:

Very good and i kept a sleeping women caught masturbating mask. They licked each stride.

85. comment by asian, on November 12, 2007 at 6:14 pm:

And he did he did he look asian slut like self.

86. comment by vapebyjrasma, on November 19, 2007 at 8:58 pm:

I kissed him and asjennifer hidden toilet cameras scrambled out. David, ahmed. She didn t come tonight.

87. pingback by AdesBlog.com » Blog Archive » My Favorite WP Plugins, on December 2, 2007 at 9:53 pm:

[...] A Different Monthly Archive Script - my post about this plugin (read here) [...]

88. comment by Rajesh, on December 29, 2007 at 4:17 am:

It will be helpful if you release ordinay php script like this for archiving.

89. pingback by Wp Wordpress » Blog Archive » A Different Monthly Archive Script, on February 25, 2008 at 9:17 am:

[...] Visit [...]

90. comment by xxx, on March 4, 2008 at 5:56 pm:

I. No xxx free movies one day, and it, as sheraised the time keeping my official anal.

[...] Nice Archives This plugin will arrange your archives (monthly) in a very nice layout. [see screenshot below] Presentation can be controlled through CSS. [...]

92. comment by Lyhaire, on July 2, 2008 at 6:22 am:

I really love this on.
But …
Is there a chance to tell this Archiv to show events I choose? I would like to keep this Archive but I would love to show my visitors upcoming Events. That would be lovely

93. comment by gadis bugil 17 tahun, on September 5, 2008 at 2:11 pm:

nice plugin i like this!
thanks

94. comment by Cafemanado, on October 4, 2008 at 5:44 pm:

Great plugin, thanks

95. comment by necyatoto, on April 22, 2009 at 3:06 pm:

hmm… cognitively :)

RSS feed for comments on this post.

Leave a comment