Last active
April 20, 2017 12:38
-
-
Save gagimilicevic/23d4973c85399571f62e961814d71ee3 to your computer and use it in GitHub Desktop.
Register custom styles and scripts Woocommerce checkout page, cart page etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function override_woo_frontend_scripts() { | |
if ( function_exists( 'is_woocommerce' ) ) { | |
if ( is_checkout() ) { | |
wp_enqueue_style( 'semantic-ui-style', 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css'); | |
wp_enqueue_script( 'semantic-ui-script', 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js', array('woocommerce'), '20151215', false ); | |
wp_enqueue_script( 'inline-bundle-script', get_template_directory_uri() . '/vendor/dist-control/inline.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'polyfills-bundle-script', get_template_directory_uri() . '/vendor/dist-control/polyfills.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'scripts-bundle-script', get_template_directory_uri() . '/vendor/dist-control/scripts.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'styles-bundle-script', get_template_directory_uri() . '/vendor/dist-control/styles.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'vendor-bundle-script', get_template_directory_uri() . '/vendor/dist-control/vendor.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'main-bundle-script', get_template_directory_uri() . '/vendor/dist-control/main.bundle.js', array('woocommerce'), '20151215', true ); | |
} | |
} | |
} | |
add_action('wp_enqueue_scripts', 'override_woo_frontend_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment