Support » Plugin: Events Manager » Remove jQuery and CSS Dependencies from all pages

  • Resolved Yash Baldawa

    (@baldawayash15)


    Hey there,
    First of all thanks for this wonderful plugin. Just want to know can I can completely remove jQuery and CSS dependencies from all the pages because I have no use of calendars and bookings. I have just use of Event Templates.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Patrick Buntsma

    (@duisterdenhaag)

    Hi,
    EM user here too. 🙂

    On your event and location pages you do need the files, so you would have to remove them conditionally.

    function stonehenge_remove_em_files() {
    $em_scripts = array('events-manager', 'events-manager-pro');
    if( !is_singular( array('event', 'location')) ) {
    	wp_dequeue_script( $em_scripts );
    	wp_derestiger_script( $em_scripts );
    	wp_dequeue_style( $em_scripts );
    		
    	wp_dequeue_script( 'jquery' );
    	wp_deregister_script( 'jquery' );
    		
    	// Delete this line if you are not using the Pro version.
    	remove_action('wp_head',array('EM_Coupons', 'wp_head'));
    }
    }
    add_action( 'wp_enqueue_scripts', 'stonehenge_remove_em_files', 999, 999);

    Keep in mind that jQuery is used throughout WordPress and many plugins, so that may cause errors.

    Yash Baldawa

    (@baldawayash15)

    Hi Patrick,
    Thanks for the quick reply. With your given function I can be able to remove EM Scripts and Styles and that worked perfectly! 🙂

    Patrick Buntsma

    (@duisterdenhaag)

    Glad to help, Yash 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove jQuery and CSS Dependencies from all pages’ is closed to new replies.