Sharing technology, ideas, insights!
Call: +91 710 466 0336         Email: hello@sanisoft.com

Blog

[WordPress Plugin] Calendar Archives

Calandar Archive

A picture is worth a 1000 words so take a look at 2 of them using first and second layouts and download the plugin

Description
Calendar Archives is a visualization plugin for your WordPress site which creates yearly calendar for your posts. Create a new page (having ‘no sidebars’ layout) for your calendar archive and insert the shortcode [calendar-archive] in the editor. Load this page and enjoy the view!

Each day of calendar will display first available photo from posts of that day in the background. The plugin’s view is customizable and has two working views in the download

Installation
1. Upload directory ‘calendar-archives’ to the ‘/wp-content/plugins/’ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Configure plugin options by clicking on ‘Settings’ link near plugin name or ‘Settings’ -> ‘Calendar Archives’ navigation link. Make sure that your plugin directory must be writable by webserver to use caching of pages and images
4. Create page having [calendar-archive] shortcode. It will be better to use empty (having no sidebars) template for this page

Note:- This plugin is tested for WordPress- 2.8.4 2.9.1 only but should work on previous 2.9.* or 2.8.* versions

About the Author

Amit Badkas is Zend certified PHP5 and Zend Framework engineer, and has been working in SANIsoft for past 10 years, his present designation is 'Technical Manager'

150 comments

  1. Hey !
    great plugin ! Nice !

    But I get an error when I display images –> “Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration”

    :/

  2. @valentin: Thanks for appreciation. You get this error because your PHP is not configured to open URLs over HTTP (that’s what the error says ‘URL file-access is disabled in the server configuration’). If you disable ‘show images’ setting for ‘calendar archives’ then this error will be gone and no images will be displayed

    @jack: I will set-up a demo soon, till that time you can try this at your local wordpress set-up (if you have any)

    Thanks

  3. @Andy: The ‘show images’ setting is ON? the ‘cached_images’ directory in plugin directory has any images? If you can change some PHP code then remove all ‘@’ (error suppression operator) from plugin file and then try to see the errors

    Thanks

  4. ‘show images’ is checked. There are no images in the ‘cached_images’ subdirectory of the plugin directory though.

    I’ll try removing the ‘@’ operators.

  5. removing ‘@’ chars had no apparent effect. But by instrumenting the code a bit, I have determined that the problem is that the call to preg_match_all() in calendar_archives.php is producing matches which are urls starting with ‘http:’. When file_get_contents() is later called on such a url, it fails.

  6. Hi.
    I downloaded the plug-in again. I published a page and it looks good but I get this when i´m publishing:

    Warning: Invalid argument supplied for foreach() in /customers/mediariket.se/mediariket.se/httpd.www/ediary/wp-content/plugins/calendar-archives/calendar-archives.php on line 223
    Warning: Invalid argument supplied for foreach() in /customers/mediariket.se/mediariket.se/httpd.www/ediary/wp-content/plugins/calendar-archives/calendar-archives.php on line 223

    Warning: Invalid argument supplied for foreach() in /customers/mediariket.se/mediariket.se/httpd.www/ediary/wp-content/plugins/calendar-archives/calendar-archives.php on line 223
    Warning: Cannot modify header information – headers already sent by (output started at /customers/mediariket.se/mediariket.se/httpd.www/ediary/wp-content/plugins/calendar-archives/calendar-archives.php:223) in /customers/mediariket.se/mediariket.se/httpd.www/ediary/wp-includes/pluggable.php on line 865

    Now I am no expert so I do not have a clue what this means. Appreciate a little help. Thanks.
    I love this plug-in so it would be nice to see it work properly. :-)

  7. @Emmi: Thanks for pointing out the problem. I guess you had this error at admin side and not while viewing calendar. Please download the plugin again and let me know more

  8. Hi Amit
    This time it works perfectly. And yes, the error was on the admin side.
    I can send you links if you want to see how they look.
    Thanks again. This plugin is great and just what i needed.

  9. Hello !
    Does anyone know why I have this error with this plugin ?
    Fatal error: Call to undefined function: file_put_contents() in /space_3/a/armand38/italien/wp-content/plugins/calendar-archives/calendar-archives.php

  10. @Dieter: Thanks for using the plugin. To change start day of week, there is no setting, I am planning to add it in next version. Till that time, you can wait or if you know PHP then also change the code as needed

    :)

  11. The plugin is really great.
    However, I didn’t figure out how to create an empty template/page without sidebars. I’m using the theme “WordPress Default 1.6″. Any hints?

  12. Really great plugin. Thank you. I have a few questions:

    1. Can you specify a particular category to show posts for?
    2. Do you have the ability to show upcoming posts?

    I would like to use the plugin to show events (posts) for upcoming and past events..

    Thanks again!

    Brian

  13. @seriocomic and @Brian: Thanks for appreciation

    @seriocomic: Yes, we are resizing the image and cache it to use that again

    @Brian: No, both of the things you need are not there in plugin but you can modify SQL query in plugin to match for your needs

    :)

  14. My friend, I know how to instert some comands, but what does this means ” insert the shortcode [calendar-archive] “, can you give me the full code to insert, I’m really ban on programing.

    thanks.
    regards.

  15. Hello – I have CHMOD my plugins folder to 777 and I still get the error: Your plugin directory (or ‘cached_pages’ directory, if it exists, in your plugin directory) is not writeable by WordPress. Caching is not possible.

    Do you have any suggestions? I checked through cpanel, and it says my plugins directory is writeable.

  16. @Autumn: You are sure that your plugin directory (the directory in which calendar archives plugin related files exist, i.e., wp-content/plugins/calendar-archives in your wordpress install) is writable by web server? If yes then check if ‘cached_pages’ directory in wp-content/plugins/calendar-archives is writable by web server or not

    Thanks

  17. @Amit, can you explain how to use the pot file to translate the plugin (i’m using poedit but don’t know what to do withe .mo and .po file generated…)
    Thank’s
    François

  18. I’m trying to make the thumbnails in the calendar clickable, rather than the titles, as my posts don’t have titles. Is this possible? I’m not sure which parts of the code to change…

  19. Thanks Amit. I know which files to edit, I was just trying to work out which bits of the code, but I’ll figure it out.

  20. Hi, great plugin. I had a problem here.
    It works well in one of my blog [http://furniturebookmark.com/archives] but It deformed on my other blog with the same plugin setting [http://gardeningbookmark.com/archives]. Any suggestion please? Thanks

  21. @Fath: Thanks for appreciation. From the information you have provided, it doesn’t clear where the problem is. Can you please elaborate more on it like if you have any errors in logs etc.?

    Amit

  22. Hi Amit – I’m very impressed with this plugin’s capabilities, but I’m having trouble getting my images to display. I think I have two different issues.

    First, an image from each post isn’t being written to the cache-images folder. I’m pretty sure I know why this is. I’ve been able to reproduce the problem, so I won’t bother you with it.

    But I’m stuck on my 2nd issue – the pictures that ARE showing up in the cache-images folder aren’t being displayed on the calendar. The calendar boxes that have images associated with them do look different (which is encouraging). On those, the date bar is a different color and I can’t see the title of the post unless I hover over the calendar box. Then I can see the post title. It’s almost as if the image is there but invisible!

    Any ideas? Thank you!!

  23. Sorry – I left the wrong website. I gave you the address of my static/html site. I’m moving to wordpress, obviously. This time I gave the correct URL.

    • Becky did you ever figure out why your images don’t show up? I have the same problem. I’m running wordpress locally

  24. Does this plugin work with NextGEN Gallery? I downloaded this plugin and made a page for it, but there are no images on the days in the calendar. It only has the title of my posts. I checked the box in the options labeled “Show images”.

  25. I figured out that if I put the image url in the post rather than inserting it from NextGEN Gallery, that it works, but is there a way to make it pick up the images from the posts if I keep adding it from the NextGEN Gallery? I’d hate to have to go into all of my posts to change how the images are inserted….

  26. hello,
    really nice plug-in!
    but i got a question on customizing it.

    is there any chance to just show one month per page and add links to the months before and after?

    thanks,
    paul

  27. HI, I love this plugin, but am having a small amount of trouble with the sizing – can you let me know how to make it slightly narrower? At the moment it is cutting off halfway across the last day of the week.
    Thanks!

    • @Laura: Thanks for appreciation. The width of calendar’s month box is calculated automatically using the image thumbnail size you have provided in plugin’s settings. So change in image thumbnail size should fix your problem.

  28. Amit,

    Great plugin.

    However, for some reason, the pictures are not showing up.

    Show Images is checked.
    There are also resized pictures in the Cached_Images folder.

  29. If there are multiple images in a post, is it the first image that is automatically selected for the calendar pic?

    Appreciate your help.

    • Thanks for appreciation. Yes, you are right. If there are multiple images in a post, the first image that has width/height greater than equals to box/image dimension (provided from admin backend) will be automatically selected for the calendar picture.

  30. Is it possible that the calendar shows post only from a specific category(s) or tag(s) ??

    This would be a great feature. Please consider telling how to do it.

    usage-1. I write several blog posts, some talk about an event, so I tag it ‘event’ and it shows up in the calendar, other posts not tagged ‘event’ don’t show in calendar.

    usage-2. same as above, except I categorize it ‘blog’ and ‘event’ category. ‘event’ category only displays in the calendar.
    Thanks for a great development. Good luck in the future!

  31. I just downloaded and am testing this as it’s just what I was looking for. One thing that would make it really cool is a drop down in the settings to choose a category to pull from.
    Just a thought.
    Great work.

  32. I used to use MovableType as my blogging software until 2004. Before moving to WP, my MT blog has a “archive calendar” (as like what this page show) but I can’t figure this out with WordPress.

    That’s what I want! Thanks for making this plugin.

  33. Great plugin Amit, many thanks. It works OK for me on WP3.0 also. Very much appreciate your hard work there.

  34. Hi,

    I’ve been using this plugin for a while and I really like its simplicity. However, is there a way to make future months show up on the calendar? For example, I have a few posts scheduled for September and I’d like them to show up on my calendar.

    Thanks in advance.

    • There was a bug due to which future months was not shown though ‘Display upcoming posts’ setting was ON but I fixed it last week and released new version of the plugin. If you update the plugin then future months should be shown.

      Thanks

  35. Hey Amit-

    Love it! Quick question…

    Is there a way to just have the date linkable instead of listing all of the posts or just listing the number of posts for that day and having that take you to all the posts for that day?

    I’m running BuddyPress. I honestly don’t know how many people will posting and would hate to have a gazillion listed.

    Any thoughts or suggestions?

    Thanks and best wishes,
    Kristen

    • Thanks for the appreciation. About the changes you need, if you know the enough PHP then can modify ‘calendar-layout-1.php’ or ‘calendar-layout-2.php’ according to the layout you are using.

  36. First of all – GREAT plugin!! This is EXACTLY what I was looking for! Thank you for all your hard work on this!

    1. I am curious as to why we need to set for no sidebars. I went back (just for giggles) and put my sidebar in after resizing the calendar and it shows great..is there going to be a future problem if I leave the sidebar there?

    2. Is there any update in the future to just show one month and then have arrows to click to the future or past months? We plan on doing a yearly calendar of “silly” holidays that will pretty much stay the same. We had wanted it to be our front page (with sidebars, widgets, etc), but since this plugin is not supposed to have sidebars, I’m a little bit leary of setting it up as such!

    Thank you again!!

  37. Hello, love calendar archives, but after the most recent upgrade I noticed that there was what I believe a bug in the plugin.

    On the archive page, everything works fine, but the month of each calendar section doesn’t appear. All the images, the days, the dates and everything else works, it’s just that the individual months seem to have disappeared. I tried looking through the files, reinstalled the plugin and check it against my theme files, but no luck.

    I was wondering if anyone else have experienced this problem.

    • Thanks for the appreciation and finding out the bug. For me, everything is working fine. Can you please give me URL of the site where you have problem, so that I can try to fix it?

  38. Dear Amit,

    I have started to get the following error:

    Fatal error: Allowed memory size of 33554432 bytes

    Any ideas how to fix this?

  39. Hi Amit,

    Thanks for the quick reply. I understand now it’s not to do with your plugin.

    My limit however is currently 100MB and I’m only using 32MB, so there is some other problem.

  40. Q from a newbie. Sorry but what do you mean by “Create page having [calendar-archive] shortcode”? Where does that information/code come from?

    Thanks.

  41. Hi there, I’m having a problem displaying the background images. Seems like the code never enters this if statement:

    if (isset($backgroundImages[$month][$day]) && false !== $backgroundImages[$month][$day])
    {
    $backgroundImage = $backgroundImages[$month][$day];
    }

    Any ideas? Show image is checked in the plug-in directory…

    Thanks,

    Javier

    • Hi Javier
      I have the same problem too and couldn’t resolve it.
      Could you please kindly let me know how you solved the problem?

      Many thanks

  42. Hi.
    First, I would like to parabenize for the amazing plugin you have made. It was exactaly what I needed.
    But, I would like to translate de month and I don’t find where to do it.
    I’ve also noted that there is more people trying to translate, whithout sucess.
    Can you give us some clues?
    Thank you.

  43. Hey,

    i would really appreciate to use your plugin but it really ruins the layout of my page that you can´t switch between showing all monthes and only one month. Is there any easy way within the PHP code to change that?

    Thanks in advance!

  44. I love this plugin. Thanks for all your hard work. One issue and one request.

    Only 2011 shows on the calendar. If I click any other year, 2011 still shows up no matter what. How do I fix this?

    Also, is there any way I can change the background image from images used in the post to the newer “featured image” used in WordPress?

    Thanks for your time!
    freefringes.com/archives

  45. Hello Amit!

    I love ur plugin very much. I’ve used it on my site. Before today its working nicely. But somehow the Plugin page doesnt show the Calendar.

    I’ve checked the shortcode [calendar-archive] is ok. I dont understand what should I do now? Could you please help me?
    You can visit this url to see the problem http://purbanchal.com/daily-archive

  46. Hi,
    I just installed the calendar archive and get it to work for the most part. I was able to create a custom page with no sidebars and the calendar displays.
    The problem I”m having is that layout 2 (which I like) displays the last day of the week of the week on a seperate row. The layout 1 doesn’t have this problem but the formatting seems off and there is not lines inbetween the days and the number of days are a bit off. I would really like to get layout two to display correctly. I have not even played around with images yet.

    Thanks for this cool plugin and hopefully I can get it to work.

  47. Amit, this is nice plugin. But I am facing some issue to display images in calendar. Show images option also on.

  48. Please, someone can it translate ti russian?
    or give a link where I can download with russian days and monthes.. thanks

  49. Love the plug in, but there is a line that shows on the page ‘view calendar for year 2010 2011′ – the years are clickable

    When I click 2010, the page reloads with no calendar, even though I have posts in 2010. Thoughts? I’d like to either make this work or remove that line!

    Thanks, patty

  50. Hi, I love the plug in! Is there anyway to only have the current month show up instead of the entire year? I am new to wordpress and I didn’t know if there was an easy way to do that? Thanks, Bonica

  51. RE [WordPress Plugin] Calendar Archives

    Hi – Great Plug in….
    Please can you tell me if there is a way that allows only ONE month at a time show?
    Thank you

  52. Happy to have found this great plug in. Thank you! It worked great at first… For some reason, now Saturday is wrapping around to the next row. How can I get the whole week back to the same row? I tried changing the size of the boxes, but it didn’t help. Any suggestions?

  53. Thanks for your great plugin, I´m already using it, but I have a question is there a way to use different width and height for the thumb used on the post?
    I need the picture to be at least 120px by 200px is there a way to do it.
    Thanks on advance.

  54. Pingback: Top Wordpress Plugins | Creative Balorina

  55. Is there any option to show month by month, not whole year at once? Also is there any option to manually code it into page template?

  56. Bug alert:

    1) finding media.php from word press core line 441 constructed a wrong resized destination path.
    2) calendar-archives.php line 578 str_replace abspath to siteurl cannot handle backward slash and forward slash properly.

    I made the following changes in order to make it work:
    media.php:
    $info = pathinfo($file);
    $dir = $info[‘dirname’];
    $fname = $info[‘filename’];
    $ext = $info[‘extension’];
    $name = wp_basename($fname);
    original
    $info = pathinfo($file);
    $dir = $info[‘dirname’];
    $ext = $info[‘extension’];
    $name = wp_basename($file);

    calendar-archives.php
    return str_replace(str_replace(‘\\’,’/’,ABSPATH), get_option(‘siteurl’) . ‘/’, str_replace(‘\\’,’/’,$resizedBackgroundImage));

    In calendar-archives.php, I think it may not be the best way to fix it. However, I need to make it work then make it right.

    Thanks.

  57. Pingback: Telmina+ » 「Calendar Archives」

  58. I left a comment here in January and kept checking for an answer for 2 months…now it seems my comment was deleted. The plugin does not work in the Safari browser. The links are not clickable. Please advise if there is a fix for this.

  59. This is just the plugin I was looking for. However, when I try to post images I get an error. It may be the path related issue Sam Folk mentioned above. As you can see, I am testing on my local wamp server, and running wordpress 3.2.1. The full-sized images are showing in the cached_images folder, but I get the following error (copied from the source code):

    <li class="day"
    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘E:\wamp\www\wordpress_mobile\wp-content\plugins\calendar-archives\cached_images/E:\wamp\www\wordpress_mobile\wp-content\plugins\calendar-archives\cached_images\113-341d44448aac6af8464d566723965c42-140.jpg’ for writing: Invalid argument in E:\wamp\www\wordpress_mobile\wp-includes\media.php on line 459

    Warning: chmod() [function.chmod]: Invalid argument in E:\wamp\www\wordpress_mobile\wp-content\plugins\calendar-archives\calendar-archives.php on line 578
    style=”background-image: url(E:\wamp\www\wordpress_mobile\wp-content\plugins\calendar-archives\cached_images\113-341d44448aac6af8464d566723965c42-140.jpg);”>

    5

    5

    test 2

    I can see that it is a path problem, but I have not made any changes to your plugin, and so don’t understand why it does not work out of the box. If anyone can see why, please let me know!

    • Hello there,

      The errors were due to handling of paths in WordPress’ image_resize() function and Windows, at one place ‘/’ is hardcoded

      It will work on Windows once this bug in WordPress is fixed

      • Thank you very much for your reply. My local install and live install are both running the latest version of wordpress. It seems this erroneous ‘/’ is only affecting the path on the local server. Maybe it is because I’ve just installed the live version and haven’t made any changes to the thumbnail image re-sizing yet.

  60. I tried on a live server and it works. Not sure what the local server issue is.

    Another question. When viewed on my iphone, the image in the calendar is not clickable. On the PC, when I hover the mouse over the calendar image, the post title link is displayed. When I click on this the post opens. On a touch device, this does not happen, and the post cannot be opened. Anyone with a fix for this?

  61. Hi!
    I have download calendar archive, and made a page for the calendar but on the settings I am getting a message for images ” [URL file-access (PHP configuration setting ‘allow_url_fopen’) is disabled in the server configuration. Hence, the images will not get downloaded and will not be displayed.] ” I read that this was fixed by your plugin in an earlier fix. I can’t get the images of the post to show in the calendar view

    Please help!
    Regards,
    Penelope

  62. Pingback: Calendar Archives | Best Plugins - wordpress – widgets – plugin 2012

  63. Hi Amit,

    I just installed your plugin on my blog…
    Configuration is easy… Everything works like a charm…

    So thank you very much.

    However, I’d like to know if an improvement can be done…
    I have many posts which don’t display an image…

    I don’t want to add an image in my posts bodies… What I would like, is to display the first image available in the attachements… (postmeta / _wp_attached_file / jpg/png/gif)

    Let me know if you find this idea interesting or stupid ;o)

    Cheers,

    W.

    • To be more precise, instead of working on post_content, using the column background from this query:

      $posts = $wpdb->get_results(“SELECT P.*, P_TEMP.guid AS background FROM ” . $wpdb->posts . ” P LEFT JOIN(SELECT P1.* FROM ” . $wpdb->posts . ” AS P1 LEFT JOIN ” . $wpdb->posts . ” AS P2 ON P1.ID = P2.ID AND P1.menu_order ‘P.YEAR(post_date) = ‘ . $year);
      $conditions[‘id’] = ‘P.ID ‘ . (0 get_results(‘SELECT DISTINCT YEAR(post_date) AS year FROM ‘ . $wpdb->posts . ‘ P WHERE post_status IN ‘ . $postStatuses . ‘ AND post_password = “” AND post_type = “post”‘ . (isset($conditions[‘id’]) ? ‘ AND ‘ . $conditions[‘id’] : ”) . ‘ ORDER BY post_date DESC’);

      Last comment regarding this code, the column background can contains 2 things: the url for the image, or NULL if none is specified…

      Cheers,

      W.

  64. Hi Amit,

    thanks for a great plugin.

    Any progress in making the plugin internationalizable? Or ETA about the new version that will be? Would be awesome if the month names could be translationable.

    Thanks again!

    Regards,
    Matheus

  65. I have tested again on the iPhone 4s and iPhone 2 and and the images and links are not clickable. I don’t know how to check the version of Safari but it’d iOS 5.

  66. I was wondering if there is a way to accomplish one of the following:

    1) Make the calendar scaleable so that it changes width for lower-res computers.
    2) Make multiple versions of the calendar. This way I can trigger which calendar version loads via media-queries.css. I have been messing around with the code, and still have had no luck with multiple width versions of a single calendar.

    You can look at the site I’m working on: http://www.structurespoetryhumans.com

    Thanks.

  67. Hi,

    It is really really a great plugin!! Readers of my blog like your plugin very much.

    However, few days ago, the website hosting company told me that I can’t put files more than 1024 in one directory. The cache folder of your plugin was pointed out by the hosting company and they asked me to removed.

    Can you teach me how to modify the plugin and separate cache files with folders year by year?

    Anyway, thank you so much.

  68. Hi,
    I really like your plugin and would like to use it in my community (apartment).
    We want to display past, current and upcoming events.
    My curent settings :
    1. Use calendar cache YES
    2. Reverse months YES
    3. Display upcoming events YES
    4. Browse by Month YES
    5. First day of week MONDAY

    I’ve created a page with the settings. Every time we open the page, it will show JANUARY as the first calendar view. Can we show CURRENT MONTH calendar view, and then we can browse to previous and next MONTHS?

    We also choose Display Layout 2. My issue is the NEXT and PREVIOUS icon position is changing depends on the length of the month. Can I make it to stay in a fixed position?

    Many many thanks for your help.

  69. in calendar-archives.php

    function __findAndBuildBackgroundImage
    Replace ‘site URL’ in background image’s URL with ‘absolute path’
    $backgroundImage = str_replace(get_option(‘siteurl’) . ‘/’, ABSPATH, $backgroundImage);

    but, wordpress can’t find image
    so,how change ‘absolute path’ to ‘relative path’

    thanks

  70. Hi!

    I’m having problem with this. After I installed WordPress and plugin, everything was working fine. But now after a couple of days, images aren’t showing up, only article title. I can’t figure out whats the problem? Do I need specific priviledges for some dictionary or what? I can’t show you my problem now, because website is under development. I’d really like to use this plugin because all the features all just right for my purpose. I’m using WordPress 3.7.1. with no other modules. Please help me with this problem.

  71. Hi! I just figuret out that new cached images are not showing up. It’s like plugin doesn’t regonize images which I upload to my articles.

    Do I have to put specific url for thumbnail images somewhere or what?

    Sincerely Aleksi

  72. Pingback: Calendar Archives | WP Plugin Directory

  73. I use plugin Calendar Archives and need to display in the site other years besides this (2013 or 2015). But calendar don’t link to it (show only 2014).
    How could I show them?

    Ty a lot.
    Vincenzo.

  74. Pingback: How To Permanently Prevent WordPress Plugins From Updating | SODEVE

  75. Hello Amit,

    I am the developer of the site “http://www.twosidedgemini.com”, but i am having problem with your plugin after updating the WP-Version to 4.0.1. Whenever the plugin is activated it leads the site to “500 misconfiguration error”. I thoroughly checked and found that this was due to this plugin. It suddenly started malfunctioning. It worked perfectly for the last 1.5 years and with all previous wordpress versions. Please suggest what to do.

    Regards Subhajit.

Leave a Reply