I created the following scripts and added them the functions.php file within my WordPress them:
add_action('wp_enqueue_scripts', 'scripts_styles');
function scripts_styles(){
if(is_page_template('Disclosures.php')){
wp_enqueue_script('jquery', get_template_directory_uri().'/js/jquery.validate.js', array(), GOVPRESS_VERSION, false );
wp_enqueue_script('jquery', get_template_directory_uri().'/js/jquery.min.js', array(), GOVPRESS_VERSION, false );
wp_enqueue_script('bootstrap', get_template_directory_uri().'/js/bootstrap.min.js', array(), GOVPRESS_VERSION, false );
wp_enqueue_script('handlebars', get_template_directory_uri().'/js/handlebars.min.js', array(), GOVPRESS_VERSION, false );
wp_enqueue_script('addrows', get_template_directory_uri().'/js/addrows.js', array(), GOVPRESS_VERSION, false );
}
}
function wpse_enqueue_page_template_styles() {
if ( is_page_template( 'Disclosures.php' ) ) {
wp_enqueue_style( 'bootstrapthemecss', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array(), GOVPRESS_VERSION, false );
wp_enqueue_style( 'bootstrapcss', get_template_directory_uri() . '/css/bootstrap.min.css', array(), GOVPRESS_VERSION, false );
wp_enqueue_style( 'maincss', get_template_directory_uri() . '/css/main.css', array(), GOVPRESS_VERSION, false );
}
}
add_action( 'wp_enqueue_scripts', 'wpse_enqueue_page_template_styles' );
However, they are not recognized by my custom template.
In other words, I tested my page with these scripts and stylesheets and they work very well.
I was able to validate form fields and display the results in the styles that was specified.
Yet, they are not validating the same form fields and page is not being styled.
What am I missing?
Just an FYI, the name of the theme is govpress.
Thanks for your help in advance.