Last active
October 4, 2016 20:38
-
-
Save luisrock/9e3bf5e91a2596fa6c1e91144a8a3891 to your computer and use it in GitHub Desktop.
WP: Including Script and Style in a Template
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 master_newHome_scripts() { | |
//js Bootstrap | |
wp_register_script('newHomeBsJs', | |
'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', | |
array('jquery'), | |
'3.3.4'); | |
//js do tema | |
wp_register_script('newHomeJs', | |
get_template_directory_uri() . '/js/newHome.js', | |
array('jquery'), | |
'1.0'); | |
} | |
add_action('wp_enqueue_scripts', 'master_newHome_scripts'); | |
function master_newHome_style() { | |
//css Bootstrap | |
wp_register_style( 'newHomeCssBs', | |
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"); | |
//css do tema | |
wp_register_style( 'newHomeCss', | |
get_template_directory_uri() . 'css/newHome.css'); | |
} | |
add_action('wp_enqueue_scripts', 'master_newHome_style'); | |
//Carregar apenas no template da home |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment