How to load UIKit in WordPress

Looking to enqueue UIKit in your WordPress site?

Add the following in your child theme’s functions.php:

add_action( 'wp_enqueue_scripts', 'custom_load_uikit' );
/**
 * Load UIKit.
 */
function custom_load_uikit() {
    wp_enqueue_style( 'uikit', '//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/css/uikit.min.css' );

    wp_enqueue_script( 'uikit', '//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit.min.js', array( 'jquery' ), '3.0.0.30', true );

    wp_enqueue_script( 'uikit-icons', '//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit-icons.min.js', array( 'jquery' ), '3.0.0.30', true );
}
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.