我已经在我的WordPress主题的functions.php中加入了脚本。我可以在开发工具中看到WordPress正在加载脚本。该脚本似乎不起作用,但。它甚至不会做console.log。自定义jQuery脚本不能在Wordpress上工作
jQuery(document).ready(function($){
$('h1').html('jQuery is working');
});
jQuery(document).ready(function($){
console.log('jQuery is working');
});
上述脚本什么也不做。我试过它只是使用普通的$而不是jQuery,没有成功(在我知道WordPress使用noConflict之前)。
任何想法为什么脚本拒绝运行?