我試圖用wp_enqueue_script
調用js庫。但我無法弄清楚我在這裏弄錯了什麼,我想用於插件請告訴我如何使用我的插件目錄。如何使用wp_enqueue_script加載js?
add_action('wp_enqueue_scripts', 'add_custom_script');
function add_custom_script(){
wp_enqueue_script(
'jquery-custom-script',
get_template_directory_uri().'/js/jquery-custom-script.js'
);
}
任何人都可以弄清楚我在這裏弄錯了什麼。
@AnandChoudhary如果此答案對您有幫助,那麼請將其標記爲已批准,以便對其他人有所幫助。 – purvik7373