I’m trying to enque stylesheet depending on template but unfortunetelly my code isn’t working. What I am doing wrong?
if ( is_page_template('single-location.php')) {
function themename_include_page_specific_css() {
wp_enqueue_style('paralax_style', get_template_directory_uri().'/paralax.css');
}
add_action('wp_enqueue_scripts', 'paralax_style');
}
I tried also with that one, but still nothing.
function load_theme_files() {
if (is_page_template('single-location.php')) {
wp_enqueue_style('paralax_style', esc_url( get_template_directory_uri() ).'/paralax.css');
}
}
add_action('wp_enqueue_scripts', 'load_theme_files');