0
以下是我的代码中的自定义主题。不过,我在将我的custom_script附加到页脚时遇到了问题。wp_enqueue_script创建致命错误
09 <?php
10 function my_scripts_method() {
11 wp_enqueue_script(
12 'custom-script',
13 get_template_directory_uri() . '/js/custom_script.js',
14 array('jquery')
15 );
16 }
17 add_action('wp_enqueue_scripts', 'my_scripts_method');
18 ?>
对我而言产生以下错误。
致命错误:不能重新声明my_scripts_method()(在* filename_removed * .PHP先前声明:12)* filename_removed * .PHP上线10