The below works great in loading a Javascript File into my theme (via a child theme)...
function my_scripts_method() {
if ( is_page_template('templates/page-alert-amber.php')):
wp_enqueue_script(
'bootstrap js',
get_stylesheet_directory_uri() . '/bootstrap/js/hellojs.js',
array( 'jquery' )
);
endif;
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
My question is - how do I also include a style sheet? I thought the below would work but it doesn't...
function my_scripts_method() {
if ( is_page_template('templates/page-alert-amber.php')):
wp_enqueue_script(
'bootstrap js',
get_stylesheet_directory_uri() . '/bootstrap/js/hellojs.js',
array('jquery')
);
wp_enqueue_style(
'bootstrap css',
get_stylesheet_directory_uri() . '/bootstrap/css/hello.css',
array()
endif;
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
thanks