我目前正在研究一个儿童主题,父母是216岁。
当前在函数中。js文件为2616,它有一个910的断点,正常菜单停止,菜单切换按钮显示。
我需要将此宽度减少到810,但不确定如何做到这一点。很明显,我不想触及216个主题文件。
我目前正在研究一个儿童主题,父母是216岁。
当前在函数中。js文件为2616,它有一个910的断点,正常菜单停止,菜单切换按钮显示。
我需要将此宽度减少到810,但不确定如何做到这一点。很明显,我不想触及216个主题文件。
复制js
父文件夹TwentySixteen
主题到子主题根。然后将以下代码添加到functions.php
-
function the_dramatist_dequeue_scripts() {
wp_dequeue_script( \'twentysixteen-script\' );
wp_deregister_script( \'twentysixteen-script\' );
}
add_action( \'wp_print_scripts\', \'the_dramatist_dequeue_scripts\' );
function the_dramatist_twentysixteen_scripts() {
wp_enqueue_script( \'twentysixteen-child-script\', get_stylesheet_directory_uri() . \'/js/functions.js\', array( \'jquery\' ), null, true );
}
add_action( \'wp_enqueue_scripts\', \'the_dramatist_twentysixteen_scripts\' );
然后在你的孩子主题中js
文件夹(之前复制的文件夹)查找functions.js
归档并进行更改。它将为您提供所需的输出。我正在开发一个插件,希望在签出页面(Woocommerce扩展)上点击下订单按钮后添加一个内嵌JS脚本。换句话说,一旦启动了wp\\u enqueue\\u脚本,是否有办法添加内联JS?