Jquery no works into wordpress -
this question has answer here:
- jquery not working in wordpress 3 answers
i use wordpres , default load library of core of jquery load it´s :
js/jquery/jquery.js?ver=1.8.3
when go insert own script of jquery result it´s no works , things easy code example no works :
$(document).ready(function(){ $("#header_sun").fadein(4000).delay(4000).fadeout(4000); $("body").css("background","#c3daec"); }); the example of code works if put in head of wordpress :
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> if put code until core jquery of wordpress scripts created in jquery works , if no put no works , don´t understand why happen because jquery put until of jquery version of core it´s same version minimun
it´s strange try , don´t understand why no works ok code , works if put or call remote library of jquery , no works load jquery of wordpress
regards !
i guess code conflicted jquery in wp-head()
insert code in functions.php
function fix_noconflict() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery' , 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' ); } add_action( 'wp_enqueue_scripts' , 'fix_noconflict' );
Comments
Post a Comment