プラグインでカスタムJavaScriptコードを使用する

カスタムJavaScriptスニペットをプラグインで使用するには、以下の方法をお勧めします:

1) WPCodeプラグイン(旧称Insert Headers and Footers)をインストールします。WordPressのプラグインページで 新規追加をクリックし、プラグイン名を検索してください。

2)WPCodeをインストールし、有効化したら、WordPressダッシュボード > Code Snippets >Header and Footerに移動します。

3) Use the following format to add your custom JavaScript snippet into the Footer section. Ensure that you include the entire code block, including the opening and closing <script> tags, as shown below.

<!-- Custom Facebook Feed JS -->
<script type="text/javascript">
function cff_custom_js($){
  var $ = jQuery;
  //Add your Custom JavaScript here
}
cff_custom_js($);
</script>

例として以下のスクリーンショットをご覧ください:

4)カスタムJavaScriptスニペットの追加が完了したら、変更を保存してください。

サポート

ドキュメントに答えが見つからない?

サポート

この記事は役に立ちましたか?