我知道我必须将鼠标指针javascript保存在我的主题库中,我是否也将函数javascript保存在我的主题库中?如果我说得不够清楚,很抱歉,如果这让人困惑,请评论!
jsfiddle.net/ctLevz8L/59/发布于 2015-02-04 12:18:11
从您的小提琴中取出javascript并将其保存到wp-content/themes/mytheme/js/hoverintent.js。
然后,将以下内容添加到主题的functions.php文件中:
function enqueue_hoverintent {
//Add the script and jquery-ui to the generated header.
wp_enqueue_script(
'my_hoverintent',
get_stylesheet_directory_uri() . '/js/hoverintent.js',
array('jquery-ui-core')
);
//Add the jqueryui css file from Google's CDN since it isn't included with WP
wp_enqueue_style (
'googlecdn_jqueryui_style',
'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css',
);
}
add_action( 'wp_enqueue_scripts', 'enqueue_hoverintent' );https://stackoverflow.com/questions/28312904
复制相似问题