Load JS Script for spesific custom post type
-
Hello,
How can I load JS Script for specific custom post type? I try the code below but it’s not working:
add_action( 'wp_enqueue_scripts', 'load_custom_js' ); function load_custom_js(){ if( is_singular() && get_post_type()=='location' ){ wp_enqueue_script( 'google-map', get_stylesheet_directory_uri() . '/maps.js', array('jquery'), '3.6.0', true ); } } add_action('wp_enqueue_scripts', 'load_custom_js');Not sure if this is related to the support.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Load JS Script for spesific custom post type’ is closed to new replies.