Is there a built in function to load scripts only for particular template?
At them moment I am doing like so:
if (is_page('portfolio') || is_page('gallery')){
wp_register_script('jScrollpane', get_bloginfo('stylesheet_directory') . '/js/jquery.jscrollpane.min.js');
wp_enqueue_script('jScrollpane');
}
and it works as long as I call the pages "portfolio" and "gallery". I would like to have it more reusable, how can I achieve that?
Thank you in advance