I have the following code in my functions.php
add_action( 'wp_enqueue_scripts', 'dc_datepicker_options' );
function dc_datepicker_options() {
if ( is_page_template( 'single-product.php' ) ) {
$ss_url = get_stylesheet_directory_uri();
wp_enqueue_script( 'datepicker-options', "{$ss_url}/js/datepicker-options.js" );
} else {
// Returns false
}
}
I’m trying to call datepicker-options.js
only on my product pages. But it doesn’t seem to be calling it.