テーマへのjQueryプラグインの組み込み方 – Snow Monkey

add_action( ‘wp_enqueue_scripts’, function() { // 使用する jQuery プラグインを読み込み wp_enqueue_script( // 半角英数字で任意の名前を設定 ‘jquery.smoothscroll’, // 使用する jQuery プラグインの URL(ローカルでも CDN でも Ok) ‘https://cdn.jsdelivr.net/npm/jquery.smoothscroll@1.0.2/src/jquery.smoothscroll.min.js’, [ ‘jquery’ ], false, true ); // jQuery プラグインを実行させるコードを記述するための js ファイル wp_enqueue_script( get_stylesheet(), get_theme_file_uri( ‘/app.js’ ), [ get_template() ], false, true ); } );

情報源: テーマへのjQueryプラグインの組み込み方 – Snow Monkey