home.php
is a template file used for displaying blog posts whether it is a homepage(front page) or any other page which is set to display blog posts.
You cannot use is_page_template('home.php')
as it is not considered a page template instead you can use is_front_page()
or is_home()
to identify the front page.
is_front_page()
always return true if we are on the frontpage/homepage
that is if we are on http://example.com
where as is_home()
returns true only if the page that we are on is set to display blog posts or the frontpage is displaying blog posts.
I guess in your case is_front_page()
works and for checking the pricing-hours.php
conditional it should be a page template
.
function everydaytherapy_script_enqueue() {
if ( is_front_page() ) {
//Here en-queue scripts for the front page
}elseif( is_page_template( 'pricing-hours.php' ) ){
// Here en-queue scripts for page template pricing-hours
}else {
//scripts for other pages
}
}
add_action( 'wp_enqueue_scripts', 'everydaytherapy_script_enqueue' );
Note:
Remember to have different handles for different styles or scripts don’t use same handle for two different css files.