IT ·

การใช้ jquery จาก Google

เนื่องจากทราฟฟิก จึงย้ายไฟล์รูปภาพและไฟล์ 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');

ใส่ความเห็น

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *