custom post with loading script per single post
What if you completely remove the loadDonateScripts function and just add the conditional before enqueuing the scripts like in the the following: function donate_adding_scripts() { if (is_single()) { global $post; if($post->ID==”8436″){ // only for post Id = 8436 wp_register_script(‘donateParsleyJs’, get_template_directory_uri() . ‘/js/parsley.min.js’, array(‘jquery’),’1.11.1′); wp_enqueue_script(‘donateParsleyJs’); wp_register_script(‘donateParsleyHeJs’, get_template_directory_uri() . ‘/js/he.js’); wp_enqueue_script(‘donateParsleyHeJs’); wp_register_script(‘donateJs’, get_template_directory_uri() . ‘/js/donateJs.js’, array(‘jquery’),’1.11.1′, true); … Read more