Releasing the Collapsing Archives WordPress Plugin

Finally getting around to releasing some more plugins. I started using the Fancy Archives plugin by Andrew Rader about the same time I started using his Fancy Categories plugin (maybe in the reverse order actually). I have been modifying it for some time now, and it seems appropriate to release it as a new plugin. The functionality is best described by simply looking at my archives list on this blog. The default wordpress archives list is a simple unordered list. This plugin gives it some dynamic capabilities, similar to the default on Blogger. I have decided to keep increasing the version number from what Andrew was using, so I am calling this version 0.6. Here are the main highlights:

  • Changed name from Fancy Archives to Collapsing Archives
  • Changed author from Andrew Rader to Robert Felty
  • Added option to link to archives.php
  • Added option to list in chronological or reverse chronological order
  • Added triangles which mark the collapsing and expanding features
    That is, clicking on the triangle collapses or expands, while clicking
    on a month or year links to the archives for the said month or year
  • Changed behavior from starting all expanded and then collapsing on page
    load to the opposite
  • Removed the rel=’hide’ and rel=’show’ tags, because they are not xhtml
    1.0 compliant. Now uses the CSS classes instead

You can download it from the WordPress plugin repository.

This entry was posted in javascript, php, sql, wiki/cms, wordpress. Bookmark the permalink.

46 Responses to Releasing the Collapsing Archives WordPress Plugin

  1. Mark says:

    Fixed it. Options, options, options. So many options. Thanks again for a great plugin.

  2. Brad says:

    I tried to use your collapsing archives plugin. Downloaded it from, unzipped, activated. At first, it showed the years and when I would expand them, the links were blank. Now, not even the years will show. Not even the fallback option shows. I have several other plugins installed, and they are all working fine. Any ideas?

  3. robfelty says:


    Thanks for being a guinea pig. I guess I should have tested the plugin on a fresh wordpress install. I had the path to the javascript file incorrectly defined. I have fixed it in the repository. Please give it another try.


  4. Rob,

    Great plugin. There is one request: The navigation to collapse and expand is a bit confusing to novice users. Is there a way to set it so that clicking on the month (which is hyperlinked) will collapse and expand the archives?

  5. Rob,

    Great plugin. There is one request: The navigation to collapse and expand is a bit confusing to novice users. Is there a way to set it so that clicking on the year and month (which are hyperlinked) will collapse and expand the archives?

  6. Pete Johnson says:

    I’ve installed Collapsing Archives and it sort of works, but it has two problems:

    – The disclosure triangles don’t rotate when clicked. In fact, they don’t do anything.

    – Last year’s disclosure triangle is stuck in a permanently open (down) position, although it doesn’t display its contents.

    I’ll leave it in place for a couple of days so you can see the problem here:

    Incidentally, I’ve double-checked the JavaScript path and it looks OK.


  7. Pete Johnson says:

    Oops. Let’s downgrade my concern to a simple cosmetic issue: the disclosure triangles do work correctly, but last year’s triangle starts in an open (down) position without revealing its contents. When I click on it, it stays down but shows the months, as it should. From then on it behaves correctly. So it’s just a problem with its starting position.

  8. robfelty says:

    Brian: I happen to disagree with you on this point. If the text (year or month) causes the list to expand and collapse, then one loses the functionality of being able to link to the entire list of archives for a year or month. And personally I think that using such triangles is pretty common. In fact, it is the default in Blogger, and is actually where I got the idea from. That being said, I also believe in giving people options, so I will try to make this an option in a future version. Thanks for your input.

    Pete: Thanks very much for noticing this. I have fixed it in version 0.6.1, so please try upgrading to that version.

    Thanks to everyone for their input and patience with me. I am still fairly new to WordPress plugin development.

  9. Rob,

    I agree with your disagreement over the text part – it wasn’t working as intended due to my permalink structure (which I have since abandoned to make use of the feature). As far as the triangles, it isn’t the traingles that is causing people to get confused, it is the lack of mouse feedback – they have no idea that clicking the triangles will do anything. If you can make it so that a mouseover the arrow does something to indicate function, I can save a text widget that I am using to explain the process :)

    Thanks for a great plugin.

  10. robfelty says:


    Thanks for the clarification. I have just added some CSS to make the cursor a pointer when you hover over the triangles, and I also added title tags to the triangles, so if you pause there with the cursor for a second or two, it will say either “click to expand” or “click to collapse”, depending on which direction the triangle is pointing.

    Thanks for the idea. I hope that helps.


  11. Brian Ritchey says:


    .7 has a problem on my site – it only shows the date for the top post in the archive month and the link doesn’t appear to work. I am assuming the change had to do with the feedback on the number of posts in a month and year checkboxes since they now retain the setting, but there may be a problem in how the link appears and operates (at least there seems to be an issue on my site with the archive coming up) – thanks

  12. robfelty says:


    Thanks again for your patience and helpful bug tips. I believe I have fixed this in version 0.7.1 (along with several other bug fixes).


  13. Rick says:

    0.7.1 doesn’t work on my site … only the first post clicked in any given session comes up, if you click on the second, it says “Whoops! That page isn’t here.”

    What it seems to be doing is it keeps appending the permalinks onto the end of the first one (thus the first one works) ad infinitim. Therefore, nothing after the first post clicked works.



  14. Cléa says:

    Hi Rob

    I’m having the same problem as Rick above. The plugin was working fine before I upgraded to 0.7.1 then 0.7.3. Now only the first link works. I will leave it up for a while on my site in case you take a look.

    Thanks for your assistance.

  15. Pete Johnson says:

    I encountered the same problem as Rick and Cléa and I found the culprit. Toward the end of the collapsArchList.php file, there is a line that reads

    echo “$text$commcount”;

    This line should be changed to

    echo “$text$commcount”;

    (Don’t know if the formatter is going to mangle these code bits, but I’d guess “yes”!)

  16. Pete Johnson says:

    Yup, it mangled the code. The culprit is the next-to-last “echo” line in collapsArchList.php. The punctuation surrounding the $link variable is wrong. If you replace the opening singlequote-dot and closing dot-singlequote with backslash-quote (in each case), the problem is fixed. Sorry for the convoluted explanation, but I can’t rely on the comment engine to reproduce literal code elements.

  17. robfelty says:

    Thanks for catching all my mistakes. I have corrected it in version 0.7.4. Also, I just installed the “codecolorer” plugin, which should allow you to type code using syntax like
    <code lang="lang">code</code>

    So, here is the change I made (on line 234 of collapsArchList.php)

    echo "<a href='.$link.' title='$title_text'>$text</a>$commcount";


    echo "<a href='$link' title='$title_text'>$text</a>$commcount";
  18. Cléa says:

    Thanks Pete for identifying the culprit, and thank you Rob for your timely response in updating the plugin. Much appreciated.

  19. Andrew Yates says:

    I have installed the plugin and I have tried to turn off the “Month Links should expand to show Posts” option. I get the following error.

    Fatal error: Call to undefined function: getmonth_link() in /wp-content/plugins/collapsing-archives/collapsArchList.php on line 169

    Great work on the plugin, will be using it alot once the above is solved. :)


  20. robfelty says:


    Thanks for your bug report. I think I have fixed it in version 0.7.5


  21. Andrew Yates says:

    No problem, looks to be working fine now.

    Thanks for the quick fix.


  22. Andrew Yates says:

    Just been tweaking the plugin a bit to do what I need it too.

    Would it be possible to have the following option…

    Don’t link year to year archive, but use as another way to drop down the month’s list. Would be helpful for me, i’m sure others might want it too!



  23. K Stone says:

    This is an awesome plugin. Thank you so much!
    Is it possible to have this display on a page.

    I already tried it using the code listed on the wordpress site, but it didn’t work. I’m actually having trouble calling any php code on a page. I’m using ExecPHP. Maybe you can recommend something that will help me?

    Thank you kindly!

  24. cindy says:

    I installed both your Collapsing Categories and Collapsing Archives plugins. The Collapsing Categories showed Chinese characters perfectly while Collapsing Archives couldn’t.

    Could you check why?

    Also, could you make the years collapsible as well, i.e. collapse all the years into one?


  25. Maria says:

    Hi, I’ve just installed both your collapsing plugins. But the triangles show as a little box and they don’t do anything. I have done exactly as the installation instructions say and use the widget type… Look at my site: as a widget far down to the right. I’m not so good at these things and have no idea why it acts like this.

  26. robfelty says:

    Cindu — I am looking into the character issue. Look for an updated version soon. I will have to think a bit more about how to collapse all years.

    Maria — I think there is probably something wrong with your .htaccess file. When I try to view the javascript source, instead of seeing the javascript, I get a 404 error. Try to access :

    You should see the same thing as at:

  27. Harry says:

    It’s not the end of the world, but is there any way to exclude a particular category from the listings? I have hundreds of daily links posts all with the same title and there’s not much point in having them appear.

    Great plugin, anyway.

  28. nobody says:

    Hi. This plug-in looks great. I installed it on my site and activated the widget (currently disabled, in case you go check). It may turn out that I don’t have the css knowledge to incorporate it into the site’s theme (I’m willing to try), but another roadblock came up first.

    Displaying the widget on the sidebar works fine, but when I go to the plugin’s settings page I only see “Are you sure you want to do this?” I viewed source and there’s no other information. Is this a known bug or did I do something wrong?


  29. robfelty says:

    @Harry – I will work on that.

    @nobody – Other people have reported that same problem, but I have been unable to reproduce it. Maybe it has something to do with your theme. It seems like this shouldn’t matter, but I have had themes break admin panels for plugins before. Please try the plugin with the default theme, and also check your server logs.



  30. Harry says:

    Oh, well, I’m sure I’m not the only person who would find it useful, but actually I’ve decided not to use your plugin because although I like the functionality it was just taking too long to load. I guess that’s probably just the sheer number of posts?

    Anyway, I went for a different solution. Thanks anyway, though.

  31. Lucian says:

    Hey Rob,

    Thanks for designing such a great plugin. I seem to be having a similar problem as a couple of readers above. The arrows on the side of the Archive list are non-functional and the year link only takes you to an archive of the year. The list won’t un-collapse. I noticed a comment above about a javascript file that should be in the plugins file, but I can’t find it. I am using WP 2.5 but I had the same problem when I tried to install collapsing archives right before I upgraded. I’ve had to resort to another collapsible archive plugin, but it is inferior to yours. Any ideas.

    Thanks in advance,


  32. K Stone says:

    Is it possible to have this display on a page?

    I already tried it using the code listed on the wordpress site, but it didn’t work. I’m actually having trouble calling any php code on a page. I’m using ExecPHP. Maybe you can recommend something that will help me?

    Thank you kindly!

  33. robfelty says:

    @K Stone – I looked at your website. It looks like you have old versions of collapsing categories and collapsing archives. Please try upgrading those first. I don’t know why you would be having trouble putting php on pages though. If

    <?php echo "hello world"; ?>

    doesn’t work, then there is a much bigger issue. Where do you host your site?

  34. Pete Johnson says:

    Hi Robert. For some reason, I can no longer see the Collapsing Archives widget in WordPress 2.5.1. Collapsing Archives appears in my Plugins screen, and it’s activated, but no sign of its Widgets cousin. It does not appear in the Widgets screen, either. I’ve tried reinstalling the Collapsing Archives files, and my FTP application shows them all in place. Any ideas?

  35. robfelty says:

    @Pete – Thanks for alerting me to that. Upgrading from 0.8 to 0.8.2 worked fine as long as you didn’t deactivate the plugin, which is why I didn’t notice the problem. It should work in version 0.8.5

  36. Pete Johnson says:

    Perfect! Thanks for the quick fix, Rob.

  37. Joost says:

    I am using the collapsing archives plugin quite successfully, but somehow the bottom 2 lines of the widget are out of line. Have a look at my website for the years 1971 and 1975. They somehow moved a little to the left compared to the lines above.

  38. Viagra Man says:

    Thx for fix) useful plugin.

  39. aleko says:

    Hi! Great work for your plugin… It’s the only one plugin that display compact articles in archives…

    I’ve some problem… I’ve installed it as widget here: and…

    I see just 2008 even if I have 2007 and 2006 articles
    Arrow is displayed only in expanding mode, so I cannot collapse the archives…

    Sorry for bad english and i hope to hear a reply soon…

  40. aleko says:

    Hi! Great work for your plugin… It’s the only one plugin that display compact articles in archives…

    I’ve some problem… I’ve installed it as widget here: and…

    I see just 2008 even if I have 2007 and 2006 articles
    Arrow is displayed only in expanding mode, so I cannot collapse the archives…

    Sorry for bad english and i hope to hear a reply soon…

    Thanks in advance

  41. Pingback: Great work, thanks.

  42. Andy says:

    Hi! Are u going to update this plugin so it fits to the collapsing categories-plugin? Images / animation, etc.. Would be very cool!

  43. robfelty says:

    @Andy – thanks for the encouragement. I finally finished updating it. See my latest post.

  44. Alfian Kurniawan says:

    Hi! I like your plugin. But there is one problem that makes me confused. After I install your plugin, the selected articles should be as bold font but not the case.
    I see your blog works well with this plugin. After I see the class = “collapsing categories item” becomes class = “collapsing categories item self” after selected. But your plugin does not work on my blog. Please give directions. Thank You. Email me about this solution.
    Sorry about my bad english

  45. Jan says:


    I just upgraded Collapsing Archives to version 2.0. The older version had the option to disable collapse/expand animation. This option seems to be gone in the newest release. How can I disable the animation?