Viewing 1 replies (of 1 total)
  • Thread Starter codydoby

    (@codydoby)

    I am tring to do this bad thing but happily it works for me. For now it only import css and js on the posts that I use gdoc

    I modified the addFrontEndScripts () in inline-gdocs-viewer.php

    
    foreach ( $scripts as $handle => $script ) {
    	// use the js only on the those two posts: id=1 and 1360
    	if ( is_single( array( 1, 1360 ) ) ) {
    		wp_enqueue_script(
    			$handle,
    			$script['src'],
    			( isset( $script['deps'] ) ) ? $script['deps'] : array()
    		);
    	}
    }
    
    • This reply was modified 3 years, 10 months ago by codydoby.
    • This reply was modified 3 years, 10 months ago by codydoby.
Viewing 1 replies (of 1 total)
  • The topic ‘Find the plugin load js and css on every page rather than only on ones are used’ is closed to new replies.