0
我想嵌入jquery.corner.js在我的wordpress主題,但我沒有運氣...在Wordpress中嵌入jquery.corner.js?
什麼是嵌入在一個WordPress主題此腳本,並使用它的正確方法?
這是腳本的鏈接,以防萬一:http://www.malsup.com/jquery/corner/
謝謝! :)
我想嵌入jquery.corner.js在我的wordpress主題,但我沒有運氣...在Wordpress中嵌入jquery.corner.js?
什麼是嵌入在一個WordPress主題此腳本,並使用它的正確方法?
這是腳本的鏈接,以防萬一:http://www.malsup.com/jquery/corner/
謝謝! :)
您應該使用wp_register_script
和wp_enqueue_script
。將該文件添加到您的主題文件夾。
function include_jquery_corner(){
wp_register_script('jq_corner', get_template_directory_uri() . 'PATH TO YOUR JS FILE');
wp_enqueue_script('jq_corner');
}
add_action('wp_enqueue_scripts', 'include_jquery_corner');