Created
November 19, 2014 20:30
-
-
Save mrbobbybryant/83c4a076da6dd67de3da to your computer and use it in GitHub Desktop.
Properly enqueue bootstrap into WordPress
This file contains 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
<?php | |
/** | |
* Enqueue scripts and styles | |
*/ | |
function your_theme_enqueue_scripts() { | |
// all styles | |
wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css', array(), 20141119 ); | |
wp_enqueue_style( 'theme-style', get_stylesheet_directory_uri() . '/css/style.css', array(), 20141119 ); | |
// all scripts | |
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20120206', true ); | |
wp_enqueue_script( 'theme-script', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '20120206', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'your_theme_enqueue_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ElisabettaCarrara and how do you ensure that your own server is secure? More secure than the CDN servers? Also, which GDPR clause are you referring to when you mention that using CDN is not allowed because of GDPR?