📌  相关文章
📜  wordpress 添加 jquery 脚本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:24.401000             🧑  作者: Mango

代码示例2
add_action( 'wp_enqueue_scripts', 'add_my_script' );
function add_my_script() {
    wp_enqueue_script(
        'your-script', // name your script so that you can attach other scripts and de-register, etc.
        get_template_directory_uri() . '/js/your-script.js', // this is the location of your script file
        array('jquery') // this array lists the scripts upon which your script depends
    );
}