我正在 WordPress 主题中调用外部 Js 文件,但它显示一些错误并且无法正常工作
我做了可能的方法,但它不起作用。
function creative_resources() {
wp_enqueue_style('style', get_stylesheet_uri(), '', 1.0);
wp_enqueue_script('script', get_template_directory_uri().'/js/main.js', array('jquery'), 1.1, true);
wp_enqueue_script('script-jqlib', get_template_directory_uri().'js/jquery-1.9.0.min.js', array('jquery'), 1.1, true);
}
add_action('wp_enqueue_scripts', 'creative_resources');
我只想要从我的 main.js 文件调用的 wp 主题中的粘性菜单。调用了 Main.js 文件但显示了一些错误,并且无法加载 jq 库....
Uncaught TypeError: $ is not a function
at main.js?ver=1.1:2
Failed to load resource: the server responded with a status of 404 (Not Found)jquery-1.9.0.min.js:1
相关分类