title: Enqueue JS and jQuery to head of specific wordpress pages
body: <p>I'm looking to add jQuery function to the head of specific pages on WordPress. It's to allow accordions to be closed after being opened.</p>
  <p>I only require to use it on -&gt; WooCommerce Single Product pages, FAQ page and Contact us page.</p>
  <ul>
  <li>Page Slugs = ('faqs','contact')</li>
  <li>is_singular('product') for Single Product Page</li>
  </ul>
  <p>Action added to <code>functions.php</code> - It saves successfully but doesn't work. Not sure what I've done wrong.</p>
  <pre><code>function my_closeaccordionscript() {
      if( is_page( array( 'faqs','contact') ) ){
          wp_enqueue_script( 'toggle-script', '/assets/js/accordiontoggle.js', array(), '1.0.0', true );
      }
      if(is_singular('product')){
          wp_enqueue_script( 'toggle-script', '/assets/js/accordiontoggle.js', array(), '1.0.0', true );
      }
  }
  add_action( 'wp_enqueue_scripts', 'my_closeaccordionscript' );
  </code></pre>
  <p>This is the file content of '<code>accordiontoggle.js</code>' which is saved in child theme directory... <code>wp-content/themes/child-theme/assets/js/accordiontoggle.js</code></p>
  <p>EDIT:</p>
  <p>The answer was to use <code>get_theme_file_uri()</code></p>
  <pre><code>{wp_enqueue_script( 'script-name', get_theme_file_uri('/assets/js/accordiontoggle.js'), array(jquery), '1.0.0', true );}
  </code></pre>