我正在尝试在我设置的子主题中包含我自己的脚本。
我有以下功能。php:
function custom_scripts() {
wp_enqueue_script(\'custom_js\', get_stylesheet_directory_uri() . \'custom_js.js\', array(\'jquery\'), \'1.0.0\', false );
}
add_action( \'wp_enqueue_scripts\', \'child_theme_configurator_css\', \'custom_scripts\', 10 );
但由于某些原因,它没有显示在页面源中的脚本区域中。我尝试放置custom\\u js。js文件位于以下路径中:
/custom_js.js (root)
/wp-includes/js/custom_js.js
/wp-content/themes/oceanwp-child/custom_js.js
但没有任何运气。任何帮助都将不胜感激。