情報技術 ·

Googleからjqueryを読み込んで使う

トラフィック対策として、画像やFlashファイルは別のサーバーに移して接続しておきました

jqueryはネットサーフィン中に以下のようなソースを見つけ、Googleに接続

変更したファイル:テーマ/functions.php

//Making jQuery Google API
function modify_jquery() 
{
  if (!is_admin())
  {
    // comment out the next two lines to load the local copy of jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', 
    'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', false, 
    '1.4.4');
    wp_enqueue_script('jquery');
  }
}
add_action('init', 'modify_jquery');

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です