• Resolved plainplow

    (@plainplow)


    Love your plugin. Thanks so much.

    I am trying to increase the speed of my site on mobile devices. As such, I am trying to eliminate render-blocking resources and all that stuff.

    I found a way to do this for the Contact Form 7 plugin:

    //* Contact Form 7
    add_action( 'wp_enqueue_scripts', 'custom_contact_script_conditional_loading' );
    
    function custom_contact_script_conditional_loading(){
       //  Edit page IDs here
       if(! is_page(206) )    
       {		
          wp_dequeue_script('contact-form-7'); // Dequeue JS Script file.
          wp_dequeue_style('contact-form-7');  // Dequeue CSS file. 
       }
    }

    I am quite ignorant of PHP coding. Can I somehow modify this code to apply to Seriously Simple Podcasting or is there another way to load the CSS for this plugin on only those pages that use the podcasting features and not on all pages?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Jonathan Bossenger

    (@psykro)

    Hi @plainplow

    You should be able to do the same thing as you are doing with Contact Form 7. The only difference would be knowing which scripts and styles to dequeue for the SSP plugin.

    add_action( 'wp_enqueue_scripts', 'custom_contact_script_conditional_loading' );
    
    function custom_contact_script_conditional_loading() {
    	//  Edit page IDs here
    	if ( ! is_page( 206 ) ) {
    		wp_dequeue_script( 'media-player' ); //Dequeue the media player script
    		wp_dequeue_script( 'html5-player' ); //Dequeue the html player script
    		wp_dequeue_style( 'ssp-frontend-player' ); //Dequeue the front end player CSS
    	}
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Seriously Simple Podcasting CSS Loading on Every Page’ is closed to new replies.