How to Resolve Problems jQuery after upgrading to WordPress 3.4


For friends who are having problems display jquery script that does not work after upgrading to WordPress 3.4, which is usually used for menu and image display our blog. The first had been confused also, why after I upgraded to version 3.4 of my wp tiba2 menu display disappear and jquery animation is also not working. After searching for solutions on the web, it turns out there is a problem in jquery, jquery wordpress 3.4 has been upgraded to version 1.7.2. The fix: Please enter the code below into the file funtions.php in your theme folder, respectively.

//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.7.1/jquery.min.js', false, '1.7.1');
  wp_enqueue_script('jquery');
 }
}
add_action('init', 'modify_jquery');
In this way will replace the source of librayy Jquery 1.7.1 kerilis implanted into WordPress 3.3 previously.

Post a Comment