Skip to content

Instantly share code, notes, and snippets.

@MoisesTedeschi
Created April 13, 2018 21:17
Show Gist options
  • Select an option

  • Save MoisesTedeschi/22e38b95699557f9f0bee09168e977b5 to your computer and use it in GitHub Desktop.

Select an option

Save MoisesTedeschi/22e38b95699557f9f0bee09168e977b5 to your computer and use it in GitHub Desktop.
Criando função "carrega_scripts" para chamar o Bootstrap via CDN.
function carrega_scripts(){
//Aqui eu estou chamando o bootstrap via CDN, mas você pode só apontar para ele se tiver local. Fiz isso abaixo do Bootstrap com o meu style.
wp_enqueue_style( 'bootstrap-css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', array(), '3.3.7', 'all');
//Mais uma importação do bootstrap via CDN, mas aqui estou importando o JS e dependência do JQuery
wp_enqueue_script( 'bootstrap-js', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', array('jquery'), null, true);
//Carregando meu estilo no projeto
wp_enqueue_style( 'style', get_template_directory_uri() . '../assets/css/style.css', array(), true);
}
add_action( 'wp_enqueue_scripts', 'carrega_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment