function my_enqueue_scripts() {
wp_register_script( 'js-1', get_stylesheet_directory_uri() . '/js/1.js' );
wp_register_script( 'js-2', get_stylesheet_directory_uri() . '/js/2.js' );
wp_register_script( 'js-3', get_stylesheet_directory_uri() . '/js/3.js' );
wp_register_script( 'js-4', get_stylesheet_directory_uri() . '/js/4.js' );
wp_register_script( 'js-5', get_stylesheet_directory_uri() . '/js/5.js' );
if( is_page_template( 'single-ad_listing.php' ) ) :
wp_enqueue_script( 'js-1', get_stylesheet_directory_uri() . '/js/1.js' );
wp_enqueue_script( 'js-2', get_stylesheet_directory_uri() . '/js/2.js' );
wp_enqueue_script( 'js-3', get_stylesheet_directory_uri() . '/js/3.js' );
wp_enqueue_script( 'js-4', get_stylesheet_directory_uri() . '/js/4.js' );
wp_enqueue_script( 'js-5', get_stylesheet_directory_uri() . '/js/5.js' );
endif;
}
add_action( 'template_redirect', 'my_enqueue_scripts' );
There are currently 1 users browsing this thread. (0 members and 1 guests)