Forum Replies Created
-
AuthorPosts
-
polozoneMember
I marked it resolved, thanks so much for your help on this issue!
polozoneMemberthis is working now, thanks for the great information - such a better way to do it!
in case it would help someone, here it is for child theme, and more than one page template
add_action( 'wp_enqueue_scripts', 'wpk_load_javascript_files' );
/*Register some javascript files, because we love javascript files. Enqueue a couple as well*/
function wpk_load_javascript_files() {
wp_register_script( 'KBcookie', get_stylesheet_directory_uri().'/js/cookie.js', array(), '1.0', true );
if ( is_page_template('cookie-head-template-no-header.php') || is_page_template('cookie-head-template.php') ) {
wp_enqueue_script('KBcookie');
}
}polozoneMemberThis looks great - I see this content (below) - can the "if (is_front_page() )" be adapted to look for a template? what would that syntax be?
"if (is_templateName() )" would that work? will try it
if ( is_front_page() ) {
wp_enqueue_script('home-page-main-flex-slider');
}polozoneMemberthank you I'll look in to that. Will I be able to direct, say many different scripts to specific sets of pages with this method? I've got different sets of forms with different validations and other types of things. I appreciate your help!
-
AuthorPosts