AJAX Calendar


Download: AJAX Calendar
Version: 2.5
Supports: WordPress 2.9 – 3.1

AJAX Calendar is a plugin that will display an AJAXified WordPress calendar. This enhances the functionality of the standard calendar by:

  • Allowing the asynchronous navigation of months, without updating the page
  • Add to blog via a widget


To install the plugin:

  1. Download AJAX Calendar
  2. Unpack the zip. You should have a directory called ajax_calendar, containing several PHP files
  3. Upload the ajax_calendar directory to the wp-content/plugins directory on your WordPress installation.
  4. Enable the calendar in your theme from the Widget page
  5. Make any modifications to your theme, as required
  6. Activate plugin

You can find full details of installing a plugin on the plugin installation page.

Support & Bugs

Support and feature requests should be made through the AJAX Calendar support forum. You can contact me directly but I spend a very limited amount of time on direct support and you stand a better chance of being answered through the forum.

If you find the plugin useful then please do consider making a donation – it is appreciated and helps towards the maintenance of the plugin.


279 thoughts on “AJAX Calendar”

  1. Great plugin, but there’s one caveat: When displaying the split list, you are only comparing the month and not the year, so I was getting entries from November of last year mixed with entries from this month. Here’s what I think the line should read like in common.php:

    $res = $wpdb->get_results (“SELECT ID,post_title FROM $wpdb->posts WHERE month(post_date) = ‘$monthnum’ AND year(post_date) = ‘$year’ AND post_status = ‘publish’ ORDER BY post_date”);

  2. I installed the ajax calendar both in a local web site and in an internet site.

    In the local site it works while in the web site http://www.sentina.it/blog doesn’t.

    When I load the blog’s homepage in the error log apache report the following error:

    “Premature end of script headers: /home/web/sentina/www.sentina.it/public_html/blog/wp-content/plugins/ajaxcalendar/server.php”

    and when I click on the calendar next/prev month I get a javascript error that say:

    “Error: xajax_giraffe_ajax_calendar is not defined”

    I think that the server apache doesn’t send the generated js to the browser.

    Any idea?

  3. Is it possible this doesn’t work with WP 2.0? I’m testing it out with Beta 1 (I know, RC1 is out), and there seems to be an error with wp-includes/capabilities.php.
    First is “The second argument, ‘Array’, should be a valid callback”, and second is “Invalid argument supplied for foreach()”. It gives line # of 142 and 146 respectively. This happens when trying to list posts from a month using the >. Otherwise, I got the plugin to work.

  4. There seems to be a bug, if I go back to november I cant get back to december. And if im viewing september it will say the next month is november.

  5. Hello!

    The calendar looks great, but it’s not completely working for me. When I click on a date, it goes to that entry just fine. However, when I click on a month or on the drop down link, all it does is show the hourglass and there isn’t any other activity.

    This is what the customizable code from common.php looks like:

    // Configuration options – modify if needed
    $giraffe_ajax_cache = true;
    $giraffe_ajax_split = true;
    $giraffe_ajax_split_open = “«-»”;
    $giraffe_ajax_split_close = “»-«”;
    $giraffe_ajax_url = “/wp-content/plugins/ajaxcalendar/server.php”; // Change the URL path, if necessary

    Otherwise, I have not touched anything else. Cache folder is set to 766. I did not put the #show-it or #wp-calendar-split options into my style.css file because I am not too versed in code yet and didn’t want to mess anything up. Am I missing anything? I am using Firefox and WordPress 1.5.2. Thanks!

  6. There are some incompatibilities with 2.0 currently, which I’ve been working on, and will soon release a newer version. Also, the problem of blank months is one caused by the way the calendar works in WordPress – if a month has no entries it skips displaying that month. This will also be ‘fixed’ in the next version.

  7. It doesn’t work with my permalinks ’cause i use following schema
    so i had to change common.php

    ——— diff ———

    — common.php.org Mon Jan 16 12:40:17 2006
    +++ common.php Mon Jan 16 12:34:12 2006
    @@ -25,7 +25,7 @@
    $year_num = date (‘Y’);

    if ($month_num 12)
    – $month_num = date (‘n’);
    + $month_num = date (‘m’);

    $monthnum = $month_num;
    $year = $year_num;
    @@ -64,7 +64,7 @@
    ob_end_clean ();

    // Add javascript
    – $text = str_replace (”, ‘<a href=”‘.get_month_link (date (‘n’), date (‘Y’)).'” rel=”nofollow”>’, $text);
    + $text = str_replace (”, ‘</a><a href=”‘.get_month_link (date (‘Y’),date (‘m’)).'” rel=”nofollow”>’, $text);
    $text = str_replace (”, ‘</a>’, $text);

    $text = str_replace (‘id=”next”></a><a href=”‘.get_month_link (date (‘n’), date (‘Y’)).'” rel=”nofollow”></a><a href=”‘.get_month_link (date (‘Y’), date (‘m’)).'” rel=”nofollow”>$giraffe_ajax_split_open</a>”;

  8. […] I was also going to try out his AJAX Calender plugin, but looks like its still for a few issues with WordPress 2.0. I’ll have to check back in on that one. And unfortunately it looks like the guy that put together the spell-checking plugin I was using isn’t going to be making a new version for WP2 any time soon. Guess I’ll have to find another one. […]

  9. The cache should be updated dynamically, as needed – the first time a request is made to display the information it will generated the cache. If this isnt working you could maybe check that the cache directory has the appropriate permissions for files to be created

  10. Hi John, I checked the permissions of the cache directory and it was set to 777. I’m not sure why the split-view list was not being updated. But, I got it to work finally. I ended up adding a line of code to common.php. Here’s the code (highlighted) if you are curious.

    if ($giraffe_ajax_cache && file_exists ($cachename))
    if (!$year_num = date (‘Y’) && $month_num = date (‘n’))
    $text = @file_get_contents ($cachename);

    The code is checking if it’s NOT the current month. If it is NOT, then get the contents from the cache. If it’s the current month, then get it from the database.

    Anyways, thanks for your work. Awesome.

  11. I got everything to work and I absolutely love it, but I have a small problem. It works fine in IE, but in all mozilla browsers like netscape and firefox corrupt the calendar. I end up having the other boxes on the sidebar overlapping the calendar. Is there something I am doing wrong?

  12. I’m running WordPress 2.0.2 and the calendar doesn’t work properly.Will this be updated? It’s really a great plugin.

  13. Yep, it doesn’t work with WP2 at all. I have got it working but haven’t had time to package it all up and make it decent enough for release. Should be out the door in a couple of days.

  14. For me the ajax calendar doesn’s ajax.The page does indeed refresh and takes a long time to do so and clicking that dropdown menu thingy doesn’t work.It keeps my page in limbo while attempting to refresh.Can’t imagine what I am doing wrong…?

  15. 2.0.2 should be fine (I’m using it here). Do you have it running on a website I can look at? I’ve probably done something stupid.

  16. My calendar doesn’t link to any new posts I create. It has links to posts created prior to the installation, but any new posts are left off. Did I mess something up in style.php that could have caused this? I didn’t touch any other code. Or is this something caused by the caching option? I noticed the live calendar at the top of this page also doesn’t link to any posts.

  17. Well its definitely a caching issue. I deleted the html file in the calendar cache and that didn’t work initially. Then I realized my entire site is being cached by another plugin (wp-cache), so when I cleared that cache it genereated a new cache with a new calendar cache as well.

  18. As seen on my blog (WP 2.0.3), I get an error : Fatal error: Call to undefined function: ajax_calendar() in /xxxxxxxxxxx/biblio-manga/wp-content/themes/default/sidebar.php on line 3

    And i put this line in “sidebar.php” :

    Any idea ? 🙁

  19. Good idea but does not work right in 2.* wordpress, I know your running it here but after inspecting the javascript in the head of your html I can see that it is different than what is being written in my html. Also I followed the links to other sites in this thread that claim it works but after using the calendar on those sites for just a few clicks the ajax errors kept popping up. I guess this is still very beta. Good Luck

  20. Hi,

    I have implemented this Calendar on my Blog and also made a review post.

    It is working fine, but there is one problem or bug. When I click `«-»` button, instead of displaying drop-down list. It opens a page of posts of that month.

    Can you advice.


  21. There seems to be have been some differences between the zip available here and the one I was actually running. I’ve re-zipped everything up and put it here for download. Hopefully that may solve some problems

  22. So, I wanted to use this, but I wanted to implement it into my sidebar via a widget. However, I have no real coding experience. So, it took me a while, and a bunch of troubleshooting, but I have an AJAX Calendar widget working on my site. One issue, however, still remains. I encounter a strange error when I click on a month link if Subscribe2 is activated. If you click on my name a download of the zipped widget file should open. I place it in /plugins/widgets/.

  23. I’m sorry, I spoke to soon. The problem is just odd because it only occurs when I reach particular months, and if I press the center link to drop down the list of post titles, then the months that give me trouble change entirely.
    Here’s the error that pops-up every time:

    Error: the XML response that was returned from the server is invalid.

    Fatal error: Call to a member function on a non-object in
    on line 420

    You have whitespace in your response.

  24. Thanks David, thats great.

    I’ve updated the plugin to use the prototype library to do all the AJAX instead of Xajax. This should hopefully make it work better.

  25. Alright, the problem is apparently with my themes. It works with Classic, but not with my other themes. Any ideas?

  26. Ok, I’m sorry, but it is working now. All I did was change from Dusk 1.2 to Classic and back to Dusk. I am lost as to why that worked, but it did. Also, the error that I had before because of a conflict between this and Subscribe2 is now gone. Thank you very much.

  27. David -Thanks for your reply. I have downloaded the new ZIP file and it display the list instead of Archive page.

    However, I need your help, I want the “Calendar” to have a same look, feel and Color as yours. Can you give me the CSS. As I have tried but could make it to only 10%.

    you can check on the sidebar of my sitehere

    Waiting for your reply.


  28. I’m sorry, I have been back here in a while, DG. I’m not sure what you mean, because I didn’t do anything to style my calendar. Its appearance is determined by my themes.

  29. Hi David,

    What I wanted was, the CSS coding for Calendar. I have tried, and I could make the Backgruond, and TopBar of the Calendar, like yours. But it fails, in the Date Box’s(Date which have post), month and > settings. And doesn’t display’s the background color and hover effects, like in your site, the dates “which has the post, has a background color, and at hover the background color changes to Black etc.


  30. Hi,

    I am using Kubrick theme and would like to view my Archive in a Calendar style but afetr downloading the plugin, activating it, and adding ‘ajax_calendar‘ into my sidebar.php, nothing seem to chnage. Have I done the right thing or not?

    Await your help.

  31. Hi,

    I have installed the plugin and included ‘ajax_calendar‘ into my sidebar. It did not show up! I thought it might because I am using Kubrick theme which does not have a calendar. If you can help me I am thankful.

  32. Great plugin. Thanks! I have it on two websites, and noticed something odd about the current month. It turns into a link if there is a entry for the first of the month, not if there are entries for the month. Odd.

    I fixed it by changing line 27 of common.php (adding two variables as well). Here is the new code:
    $this_month = date(“Y-m-01”);
    $next_month = date(“Y-m-01”,strtotime(“next month”));
    $current = $wpdb->get_row (“SELECT count(post_date) as count FROM $wpdb->posts WHERE post_date > ‘$this_month’ AND post_date

  33. Love the look.
    Does this work with the widgets in K2?
    When I activate the plugin, it doesn’t appear in the widgets list for the sidebar.
    Unless I’m missing something, that would be really cool.


  34. Can you use this calendar format with other types of fields …
    I want a calendar that lists all the people that have put that they are available that month.
    Once clicking on the drop down list of people,(where you have the “>” in the demo) it will take you to their individual page with their informaton- times, name, address (not a blog posting) etc.
    Is this possible or is the database table configured to always look for new posts to the blog?

  35. There is a compatibility issue when you upgraded to WordPress v2.1, which list out pages as posts. To fix it, I have made some changes in the common.php file:

    wherever there is: post_status = ‘publish’
    replace it with: post_type = ‘post’ AND post_status = ‘publish’

    I am not sure if people all have this issue, but just want to share this.


  36. Is there a way to get the year to show with the month above the days of the week? So it would be March 2007 instead of just March. That make sense?

    Great plugin!

  37. Hi! This is a great plugin, also the widget by David but I’m a spanish blogger, so I use accents. The problem is that I can’t see it from this plugin and a text like that: Actualización a WordPress 2.1 “Elle” shows as: Actualización a WordPress 2.1 “Elle” . How can I fix that? Thanks

  38. john,

    I’m using this nice plugin for a long time, however, recently, I’ve started facing problem, as detailed under:

    The problem that I’m facing is with plugin path. I’ve WordPress in a sub-directory, the structure is as follows:

    WP URL: http://www.ditii.com/blog
    Site URL: http://www.ditii.com

    a. With the above structure, if I set site url as:
    http://www.ditii.com/, the plugin stops functioning, that’s none of the functions work.

    b.If I set site url as:
    http://www.ditii.com/blog, it works.

    Can you tell me, what could be the reason of this error, as I’ve tried all means myself, but couldn’t fix it.


  39. I have WP 2.0.6.. but I use permalink schema /archives/postnumber, not year/month/date/name-of-post

    What changes do I need to make in order for this to work?


  40. Correction.. I used the 1.5 version instead of the 2.1 version now, and it “almost works”… except the navigation and the drop-down… the current month works just fine, but cannot go to the previous month nor can I see the drop-down…

    Any suggestions?

  41. Awesome Plugin. Love it. Using it on my comic site, which is great in place for the monthly archive or recent posts.

    Two quick questions:

    1. Is it possible to set it so the drop down show initially, and then collapses, instead of vice versa?

    2. Can I exclude certain categories from the calendar? I have a ‘sideblog’ for news etc, and I’d like the calendar to ignore it.

  42. Daniel, I’ve added a parameter which allows you to enable full details. If you want to enable this edit the common.php file and set:

    $giraffe_ajax_always = true;

    Ignoring categories will require quite a major rework to the plugin so I’m afraid I’ve not done that for the moment.

  43. is there any way of having this calendar work with future events as well?

    So users could navigate around the calendar going fwd and any future events/posts would be highlighted on the calendar and clickable to the page.

  44. John,

    Nice plugin, I’ve few query’s, I hope to hear this time from you:

    1. My Blog is located under su-dir e.g. http://www.xyz.com/blog

    and, I’ve placed index.php in the root dir of my domain. Now, my blog URI should be as: http://www.xyz.com. Here is the problem, if I change my blog URI(as it should be) to http://www.xyz.com, the calendar stops functioning.

    If I change it back to http://www.xyz.com/blog, it runs.

    Can you advice me, what changes should I make to let the calendar funtion from http://www.xyz.com URI.

    2. With WordPress 2.2 onwards prototype and scriptaculous scritps are bundled with the core files. How do we avoid loading prototype from the ajax calendar? as it’s already loaded by WordPress software.


  45. Mosey & Jon: Future events shouldn’t be difficult to add but I’m not entirely sure why you’d want it? Usually future posts are private and not accessible to visitors. Putting support in the plugin for them would effectively be a way for people to see posts before they are ready

    DG: Are there any JavaScript errors? I have this site running in a setup similar to what you describe and experienced no problems. Prototype/scriptaculous are only loaded by WordPress in the administration interface, they are not loaded on the front-end unless your theme chooses to do so.

  46. Hello there,

    Your plugin looks great, but it didn’t work with my website (here) and I don’t know why.

    I work with WordPress 2.2.1, so I downloaded the ajax calendar version 2.3.1. I activated the plugin, and I added the tag in my sidebar.

    Yes, a calendar shows up, but that’s nothing to do with your ajax calendar. Actually it’s the default WordPress calendar. You can see it on my website.

    I really need help. Thanks a lot for the plugin once again.

    Hope to hear from you soon.

  47. Why would you want future events? To announce an upcoming meeting, conference, or concert. It’s an essential calendar feature, and has little or nothing to do with seeing or not seeing blog posts.

  48. Aleph, I’m still not sure I get it. If you need to announce something you can announce it in advance of it actually happening using a normal post. The WordPress calendar is simply a method to show your history of postings, it’s not meant to be a system for future scheduling. If a post is set for the future then I suspect that WordPress marks it as unpublished, meaning that normal users will not be able to read it anyway.

    Serkan, did you insert ajax_calendar into your sidebar, and not just get_calendar?

  49. Serkan, the AJAX calendar is definitely appearing on your site, but the JavaScript library ‘prototype’ is not being used, so an error occurs whenever the calendar is used. You will need:

    <script type="text/javascript" src="/pathtowordpress/wp-content/plugins/ajax-calendar/prototype.js"></script>

  50. Actually, something changed. When I press the « button, now it gets me the 404 page. So, we can tell that the ajax code is working well. But;

    – Why does it show me 404 error?
    – Why can’t I change anything visually? You can see that the calendar is pretty ugly and I don’t know how to change it.

    Thanks very much for your help.

  51. Serkan, the 404 occurs because one of the required files is not where it should be. It really sounds like something went wrong with the installation of the plugin. You can change the style of the calendar by using CSS. The new version includes some default style.

    Brian, the plugin was not widget enabled, but it is now.

  52. Is there any widget for your plugin?

    It don’t work without with WordPress 2.2.2. I activated it, but there is still the normal WordPress calendar. No AJAX. Do I need to place somewhere a special code? I thought it simply replace the standard calendar.

    I need some help please!

  53. Alfons, yes there is support, but as the software is developed in my personal time a response is not going to be immediate.

    Shantall, yes there is a widget, and it does work with WP 2.2.2. It won’t replace the standard calendar, you have to add the AJAX calendar either through a widget or by inserting the ajax_calendar () function in place of the standard wp_calendar

  54. Hi UG – this plugin looks cool but have you noticed that in Firefox (I haven’t checked it in any other browsers) when you mouseover the center link between the months at the bottom of the calendar that the margins are squeezed so the insides of the calendar ‘move’ (are squeezed? I’m not sure how best to describe it) – if you aren’t aware of this behavior I can take screenshots to show you the difference between the the look of the calendar normally and then when mousedover – if you are aware, do you have plans to fix this or is it just a quirk of css that can’t be helped?

  55. Hi,

    I spent like an hour researching it now. I have 2.2.2 wordpress running on adir1.com and lost of active widgets.

    However, even once the Ajax Calendar plugin is Activated, widget doesn’t show up. It appears that nothing calls template_redirect from the administrative console, where under Presentation I am trying to see/add the Ajax calendar.

    I did verify that widget gets properly registered on the Blog itself, but I can’t add it via Dashboard if it does not show up there.

    I tried fixing it, but the class redirection that you are using with &$this is not something I am familiar with.

    I think a lot of people are having this issue, as can be seen in the comments.

    Any suggestions or help is greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *