Skip to content

Instantly share code, notes, and snippets.

@amilabandara
Last active August 29, 2015 14:14
Show Gist options
  • Save amilabandara/bd37dcaf3d01f43c9b8e to your computer and use it in GitHub Desktop.
Save amilabandara/bd37dcaf3d01f43c9b8e to your computer and use it in GitHub Desktop.
Add Bootstrap 3 to Wordpress theme
<?php
//add this function to Wordpress theme function.php file
function loadBootstrap() {
wp_register_script( 'bootstrap-js', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery'), NULL, true );
wp_register_style( 'bootstrap-css', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css', false, NULL, 'all' );
wp_enqueue_script( 'bootstrap-js' );
wp_enqueue_style( 'bootstrap-css' );
}
add_action( 'wp_enqueue_scripts', 'loadBootstrap' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment