I'm attempting to load a couple of scripts based on the template in use. However, the is_page_template is not activating.
From my functions.php in the child theme I have:
function sectionDescription (){
if (is_page_template('taxonomy-tableofcontents.php')){
wp_enqueue_script('descriptionsectiontitle');
wp_enqueue_script('descriptionsectionbody');
}
}
add_action('wp_enqueue_scripts', 'sectionDescription');
I can't see a syntax problem. I'm assuming that you can use this conditional in the functions file to control the enqueueing of scripts, I can't find anything to the contrary. As I've looked around at other examples my formatting seems to be correct.
I'd appreciate any suggestions on a possible source of the problem.
Note: The scripts are registered in another section of the functions file. When I first loaded the scripts I had the registration and enqueue together and loading on every page. This worked as expected so I don't doubt the syntax of the registration and enqueueing.
I added some test php to the page to test the activation of the is_page_template and it indicates that the conditional statement is not working.
I'm thinking that I don't understand how to use this conditional but I can't see what's missing.
taxonomy-tableofcontents.phpis for displaying the 'tableofcontents' taxonomy archive?