最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - Why does my wp_enqueue_script() only insert the script for logged in users

programmeradmin2浏览0评论

I've got a really simple enqueue in my functions.php file. The weird thing is that it only actually inserts the script if I'm logged in. I've tried wiping out everything else in the functions.php but it doesn't change anything. I'm not even sure what to try next. Any ideas?

function enqueue_my_script() {
    wp_enqueue_script( 'my-script', get_stylesheet_directory_uri() . '/my-script.js');
}
add_action( 'wp_enqueue_scripts', 'enqueue_my_script' );
发布评论

评论列表(0)

  1. 暂无评论