title: is_page_template() not working in functions.php
body: <p>So I've got a script that I'd like to include in only a template file. The template file is located in a folder called templates in my child theme. I thought I could do it by including an if statement in functions.php and targeting the template file by name like so:</p>
  
  <pre><code>function header_anim() {
  wp_enqueue_script( 'head', get_stylesheet_directory_uri() . '/js/head.js' );
  }
  
  if( is_page_template( '/templates/home-template.php' )) {
      add_action( 'wp_enqueue_scripts', 'header_anim' );
  }
  </code></pre>
  
  <p>However, it seems as though it's not recognizing the if statement for some reason. </p>