CDC Clean Archives

This is a quick and hasty hacking of the SRG Clean Archives by Shawn Grimes.

I’d been wanting to modify it a bit to allow for collapsing each month to require less scrolling. Currently in this version aside from the months collapsing using the fx.Accordion effect in the Moo.fx libraries it’s precisely the same as Shawn Grimes published plugin.

You can see it in action on my archives page.

How do I use it?

Upload the cdc_clean_archives.php to your wp-content/plugins/ folder and activate it through your wordpress admin panel.

The Month/Year format is surrounded by “h5” tags. If you would like to change this, just open up the cdc_clean_archives.php file and look for this line of code:

echo get_archives_link(‘#’, $text, ”,’

‘,’

‘,”);

There you can change the current tags to whatever you would like to use. Such as a h2, h3, etc. and re-save the file. Just be sure not to delete the quote marks or the class name (that’s what allows the accordion effect).

The list of of articles can be styled in your css by setting up a .postspermonth class.

Here is an example:

.postspermonth {
margin: 5px 0 10px 0;
list-style: none;
padding-left: 25px;
}

The output from this plug-in is already wrapped in the needed “ul” tags. All you need to do is customize the class to your taste.

To call the plug-in all you need to do is insert the following string of code where you want the archives to be displayed, ie your sidebar or on a separate archive page:

cdc_clean_archives()

Then add this to the head of your archive page:

Version .60:

Integrated the moo.fx javascripts into the function simplifying the installation of the plugin.

And that is all. Enjoy!

To see a working example of this plug-in please visit http://www.cdcstudios.com/archive.php

Credits:
==============================================
Shawn Grimes (http://hexfactor.com)
Sebastian Schmieg (http://www.kingcosmonaut.de)
Chris J. Davis (http://www.chrisjdavis.org)
Skippy (http://skippy.net/)
Jan (http://www.foundandlost.nl/)

Development has stopped on this plugin. I’d highly recommend this version instead:
http://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/
It uses a much better caching system than mine.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • NewsVine

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

43 Responses to “CDC Clean Archives”

  1. Ole Says:

    Thanks for the nice Clean AJAX Archives!

  2. Ole Says:

    Thanks for the nice Clean AJAX Archives!

  3. Kahil Says:

    The only thing that I think should be fixed is that when you have the page scrolled down and you click to have something expand, it automatically goes back to the top of the page and then you are forced to scroll back down. Is there a way to prevent that?

    Thank you,

    Kahil

  4. Kahil Says:

    The only thing that I think should be fixed is that when you have the page scrolled down and you click to have something expand, it automatically goes back to the top of the page and then you are forced to scroll back down. Is there a way to prevent that?

    Thank you,

    Kahil

  5. Tal Galili Says:

    Great plugin – I will go to use it soon.
    Waiting and hoping for the next upgrades :)

    Tal.

  6. Tal Galili Says:

    Great plugin – I will go to use it soon.
    Waiting and hoping for the next upgrades :)

    Tal.

  7. matt Says:

    I have followed your instructions (installed the plugin, placed php call on the archive page, uploaded scripts and linked them in my header). The archive list shows up but without the accordian effect. All I know is that there are a couple of undefined classes:
    moo.fx.js line 57
    moo.fx.pack.js line 10
    .. though I doubt that that actually makes any difference.

    I had been using Hicksdesign style archives but was fed up with the scrolling too.
    Any ideas? Known bugs?

    Looks great on your site.

  8. matt Says:

    I have followed your instructions (installed the plugin, placed php call on the archive page, uploaded scripts and linked them in my header). The archive list shows up but without the accordian effect. All I know is that there are a couple of undefined classes:
    moo.fx.js line 57
    moo.fx.pack.js line 10
    .. though I doubt that that actually makes any difference.

    I had been using Hicksdesign style archives but was fed up with the scrolling too.
    Any ideas? Known bugs?

    Looks great on your site.

  9. Kit Says:

    I’m having the same issue as Matt, above, after having followed the same steps. Just chiming in so I’ll remember to come back and look for an update!

  10. Kit Says:

    I’m having the same issue as Matt, above, after having followed the same steps. Just chiming in so I’ll remember to come back and look for an update!

  11. Chris Says:

    Are you using the archives on a page or on a standalone “archives.php” style page? I have had infrequent issues with people using pages generated by wordpress. I’ll be releasing an update with a few new bug fixes that’ll fix issues with IE 7 as well as really trying to nail down the pages issue (I still haven’t encountered it here or on my test blog).
    If you can turn the plugin on and then let me take a look at it I’ll try and resolve the issue for you.

  12. Chris Says:

    Are you using the archives on a page or on a standalone “archives.php” style page? I have had infrequent issues with people using pages generated by wordpress. I’ll be releasing an update with a few new bug fixes that’ll fix issues with IE 7 as well as really trying to nail down the pages issue (I still haven’t encountered it here or on my test blog).
    If you can turn the plugin on and then let me take a look at it I’ll try and resolve the issue for you.

  13. Alex Says:

    Hi Chris, your plugin looks pretty impressive, but I’m a newbie so I really have no clue with the instruction. Where exactly do I have to put the javascript? In the archive.php of my theme? And do I have to put the javascripts in the js folder of my theme?

    I tried these already and activate the plugin but doesn’t work so far.

    Sorry for these stupid questions, I appreciate your help.

    Alex

  14. Alex Says:

    Hi Chris, your plugin looks pretty impressive, but I’m a newbie so I really have no clue with the instruction. Where exactly do I have to put the javascript? In the archive.php of my theme? And do I have to put the javascripts in the js folder of my theme?

    I tried these already and activate the plugin but doesn’t work so far.

    Sorry for these stupid questions, I appreciate your help.

    Alex

  15. Chris Says:

    All you need to do is add the following to a new page (outside of wordpress) named archive.php : cdc_clean_archives()
    IF that doesn’t work let me know and I’ll email you for more information.

  16. Chris Says:

    All you need to do is add the following to a new page (outside of wordpress) named archive.php : cdc_clean_archives()
    IF that doesn’t work let me know and I’ll email you for more information.

  17. Alex Says:

    Thanks Chris for your answer, but it doesn’t work, as a test I put the scripts in a “scripts” folder and created an archive.php file. Still not working.

    http://www.derfrison.com/archive.php

    I really appreciate your help

    Alex

  18. Chris Says:

    Try making a copy of your themes page template and then renaming it archive.php and then put the required tag into the middle where the post portion should go.
    That should fix the issue. Send me an email via my contact page if you’d like me to do it for you. I’m currently trying to find a way around the wordpress not allowing php to be run in a post without requiring yet another plugin.

  19. Alex Says:

    Thanks Chris for your answer, but it doesn’t work, as a test I put the scripts in a “scripts” folder and created an archive.php file. Still not working.

    http://www.derfrison.com/archive.php

    I really appreciate your help

    Alex

  20. Chris Says:

    Try making a copy of your themes page template and then renaming it archive.php and then put the required tag into the middle where the post portion should go.
    That should fix the issue. Send me an email via my contact page if you’d like me to do it for you. I’m currently trying to find a way around the wordpress not allowing php to be run in a post without requiring yet another plugin.

  21. Juliano Says:

    Hello Chris,
    I’m having the same issue as Alex, but I managed to make the correct changes (at least I think I had). Nothing appears :(
    And I’m sure the “cdc_clean_archives.php” file is being loaded, because if you take a look at the source code of my archives page it shows the three js. calls:
    http://blog.ipbrasil.com/arquivos/
    Any ideas?
    I really would love to have your plugin working in my blog.

    Thanks,
    Juliano.

  22. Juliano Says:

    Hello Chris,
    I’m having the same issue as Alex, but I managed to make the correct changes (at least I think I had). Nothing appears :(
    And I’m sure the “cdc_clean_archives.php” file is being loaded, because if you take a look at the source code of my archives page it shows the three js. calls:
    http://blog.ipbrasil.com/arquivos/
    Any ideas?
    I really would love to have your plugin working in my blog.

    Thanks,
    Juliano.

  23. Chris Says:

    Here’s the easiest solution I can give you.
    Go to your wp-content/templates/<template you=”you” use=”use”>
    and copy the index.php file. Rename the copy to archive.php then delete the entire “post” div and replace it with this:
    <div id="archive"><h1>< ?php _e(‘Archives:’); ?></h1>

    Click any of the months below to see a list of the all posts from that month.

    < ?php cdc_clean_archives() ?>

    </div>
    Save that archive.php file in your root directory (http://yourdomain.com/archive.php)
    That should fix the issues perfectly.
    Let me know if there is anything else.</template>

  24. Chris Says:

    Here’s the easiest solution I can give you.
    Go to your wp-content/templates/

  25. Juliano Says:

    Hmm, I don’t have a “wp-content/templates/”, but a “wp-content/themes/” folder, and there isn’t an index.php file in there…
    I noticed that the theme I’m using is a litle different from the default and classic themes, and maybe that’s the problem. What I made was to take the index.php file from another theme, remove the “post” div and add the code you gave me, but that didn’t work too.
    The odd thing is that I tried the srg_clean_archives before testing yours and it didn’t work too… :(

    If I send access data to you (FTP and admin panel), would you take a look at this for me, please? I’m not in a hurry at all.

    I appreciate your help :)

  26. Juliano Says:

    Hmm, I don’t have a “wp-content/templates/”, but a “wp-content/themes/” folder, and there isn’t an index.php file in there…
    I noticed that the theme I’m using is a litle different from the default and classic themes, and maybe that’s the problem. What I made was to take the index.php file from another theme, remove the “post” div and add the code you gave me, but that didn’t work too.
    The odd thing is that I tried the srg_clean_archives before testing yours and it didn’t work too… :(

    If I send access data to you (FTP and admin panel), would you take a look at this for me, please? I’m not in a hurry at all.

    I appreciate your help :)

  27. Chris Says:

    That’d be fine Juliano. I’d be happy to take a look at it.

  28. Chris Says:

    That’d be fine Juliano. I’d be happy to take a look at it.

  29. Archive and search changes - soupnazi.org Says:

    [...] To do so, I created a plugin (which may end up on the projects page if anyone express interest in having it) based on Chris O’Rourke’s CDC Clean Archives plugin (which is based on Shawn Grimes’ Clean Archives plugin. [...]

  30. scart Says:

    hello, its not working to me either… is the plugins already fix?

  31. scart Says:

    hello, its not working to me either… is the plugins already fix?

  32. Chris Says:

    Since Viper’s done a much better version of this, I’m going to end development of it for now. It might end up integrated into the next big moodash release but likely it is done for good.

  33. Chris Says:

    Since Viper’s done a much better version of this, I’m going to end development of it for now. It might end up integrated into the next big moodash release but likely it is done for good.

  34. killercup Says:

    hello,
    i would like to integrate this great plugin in my theme – it’s full of moo.fx!
    everything works fine, but there are no effects!
    the reason might be that i’m using the lite version of prototype. please have a look at http://web2.vs242109.vserver.de/index.php/archiv (my test blog) and i hope you can tell me how to have the same effect with prototye.lite :)

  35. killercup Says:

    hello,
    i would like to integrate this great plugin in my theme – it’s full of moo.fx!
    everything works fine, but there are no effects!
    the reason might be that i’m using the lite version of prototype. please have a look at http://web2.vs242109.vserver.de/index.php/archiv (my test blog) and i hope you can tell me how to have the same effect with prototye.lite :)

  36. killercup Says:

    ok, i ve solved my problem. “indow.onload” does not work. ;)

  37. killercup Says:

    ok, i ve solved my problem. “indow.onload” does not work. ;)

  38. enrico Says:

    hi

    i could exclude a category from the archive?

    how to?

    thnx

  39. enrico Says:

    hi

    i could exclude a category from the archive?

    how to?

    thnx

  40. Chris Says:

    I’m not sure how you’d do that actually.

  41. Chris Says:

    I’m not sure how you’d do that actually.

  42. j david macor.com | The Best Wordpress Plugins Revisited Says:

    [...] CDC CLean Archives: Great archive generating plugin, with neat effects. [...]

  43. j david macor.com » Blog Archive » The Best Wordpress Plugins Revisited Says:

    [...] CDC CLean Archives: Great archive generating plugin, with neat effects. [...]