Posted By

depiction on 12/12/12


Tagged


Versions (?)

Wordpress: Deregister All in One Event Calendar CSS


 / Published in: PHP
 

URL: http://ditscheri.com/blog/deregister-css-and-js-files-from-all-in-one-event-calendar-plugin

Deregister All in One Event Calendar CSS so it's not on every page. Afterwards, add the CSS files directly to the calendar pages. This way they are only loaded when needed.

  1. // clean up unwanted JS scripts
  2. function my_print_scripts(){
  3. if ( !is_admin() ) {
  4. wp_deregister_script('jquery');
  5. wp_deregister_script('ai1ec_requirejs');
  6. }
  7. }
  8. add_action('wp_print_scripts', 'my_print_scripts');
  9.  
  10. // clean up unwanted CSS
  11. function my_print_css() {
  12. if ( !is_admin() ) {
  13. wp_deregister_style('ai1ec-general');
  14. wp_deregister_style('ai1ec-event');
  15. wp_deregister_style('ai1ec-calendar');
  16. }
  17. }
  18. add_action('wp_print_styles', 'my_print_css');

Report this snippet  

You need to login to post a comment.