WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] wp_deregister_style not working with All in One Event Calendar (6 posts)

  1. depiction
    Member
    Posted 1 year ago #

    All in One Event Calendar adds 2 CSS files to every page, even page that don't have a calendar on them.

    I'm trying to deregister the scripts then manually add them to my calendar page.

    I found the handles in class-ai1ec-calendar-controller.php then added the following to my theme's functions file, but both scripts are still appearing in the header of all pages. How do I remove them?

    function my_deregister_javascript() {
    		wp_deregister_style('ai1ec-general');
    		wp_deregister_style('ai1ec-event');
    	}
    
    	add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. Richard
    Member
    Posted 1 year ago #

    Hi depiction,

    We going to have our Technical Support Specialist take a look at this. She will provide a response shortly.

  3. Ula Szczepaniak
    Member
    Posted 1 year ago #

    @depiction,
    Did you try with wp_enqueue_scripts?
    Regards

  4. depiction
    Member
    Posted 1 year ago #

    You mean wp_deregister_scripts? Yes, I've tried that. Since the CSS files are added in ai1ec via wp_enqueue_style, wp_deregister_style should work.

    I tried deactivating all other plugins to see if it might be a plugin issue. I also tried using the default theme. Neither solved the problem. I'm using WordPress 3.4.2.

  5. ditscheri
    Member
    Posted 1 year ago #

    Hi depiction,

    have a look at this code snippet. It removes both the CSS and the JS files:
    http://ditscheri.com/blog/deregister-css-and-js-files-from-all-in-one-event-calendar-plugin

  6. Richard
    Member
    Posted 1 year ago #

    @ditscheri - thanks for this. Certainly might be an option for some users / WP themes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic