wp_register_script没有加载脚本

时间:2017-03-12 19:27:03

标签: javascript wordpress wordpress-theming

function enqueue_my_so_scripts() {

	wp_register_script('theme-custom-js', get_template_directory_uri().'/js/custom.js', array(), '', false );
	wp_register_script('theme-bootstrap-js', get_template_directory_uri().'/js/bootstrap.min.js', array(), '3.3.7', true );

	wp_enqueue_script('theme-custom-js');
	wp_enqueue_script('theme-bootstrap-js');
}
add_action( 'wp_enqueue_scripts', 'enqueue_my_so_scripts' );

我不确定为什么脚本没有加载任何想法...... !!

1 个答案:

答案 0 :(得分:0)

我检查了您的域script_score,我可以看到脚本custom.js和bootstrap.min.js都在页脚中加载。

如果您仍未看到脚本,则可能会出现缓存问题。尝试清除缓存并在其他浏览器中加载您的域名。