If you are using the time.ly All-in-One Event Calendar Plugin, I’m sure you’ve had some issues with it.
It’s a great plugin, and a swiss army knife for displaying Calendars on your WordPress site. However – being a swiss army knife is the source of a lot of problems. Every programmer knows that no user uses his software the way it was intended, and trying to cover every single task your users want, is both parts impossible and the root of a lot of problems.
However, I’m glad to have the Plugin available.
What I got for you is a quick fix, if you are using the latest version of WordPress (I really hope you do!), and Version 2 of time.ly All-in-One Event Calendar (in my case Version 2.0.6).
The issue is that in your WordPress Admin your Metaboxes do not collapse/open. The settings get saved, So if you click to close and reload the page, your Metabox will be closed, but without reloading the status stays the same.
The solution is to enqueue a rather simple .js file, I called mine admin-ai1ec-fix.js:
1 2 3 4 5 6 7 8 9 |
jQuery(document).ready(function($) { $('.handlediv').click( function() { if( $(this).parent().hasClass('closed') ) { $(this).parent().removeClass('closed'); } else { $(this).parent().addClass('closed'); } } ); }); |
Now with that small script in your library, you just need to enqueue it, but only in admin. Put this code in your functions.php:
1 2 3 4 5 6 |
function addAi1ecHotfix(){ // change the filepath to your own one! wp_register_script( 'admin-ai1ec-fix', get_template_directory_uri() . '/scripts/admin-ai1ec-fix.js', array('jquery'), null, true ); wp_enqueue_script( 'admin-ai1ec-fix' ); } add_action( 'admin_enqueue_scripts', 'addAi1ecHotfix', 9999 ); |
Voila! Enjoy the glory of your Calendar without having your clients calling you, claiming their mouse does not work.
You’re welcome!
Hey there! This post couldn’t be written any better! Reading through this post reminds me of my good
old room mate! He always kept chatting about this.
I will forward this post to him. Fairly certain he will have
a good read. Many thanks for sharing!