Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Dequeue CSS/JS file on mobile **/
- function dequeue_conditional_mobile_styles_scripts() {
- // First check that wp_is_mobile didn't disappear for some reason
- if ( function_exists( 'wp_is_mobile' ) ) {
- //dequeue scripts and styles if it's for a mobile device.
- if ( wp_is_mobile() ) {
- wp_dequeue_style( 'magnific-popup' );
- wp_dequeue_script( 'jquery-magnific-popup' );
- }
- }
- }
- add_action( 'wp_enqueue_scripts', 'dequeue_conditional_mobile_styles_scripts', 100 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement