brettlewis
Member
Posted 2 years ago #
I am trying to implement code from this page
but cants get the jquery to work. It keeps falling back to the CSS code. I have tried replaceing $ with $j and all that other annoying conflicting code. Any suggestions on how to get it to work?
I also have tried the code.jquery, googleapi, and wp_enqueue_script("jquery") hosted versions of jquery to no avail.
I constantly have jquery issues in wordpress and need to know how to stop them one and for all!
Thank you
brettlewis
Member
Posted 2 years ago #
actually I used this script.
I read through the page a tried a few things. It took a while but if anyone else was interested this is what i used:
in header:
<?php wp_enqueue_script("jquery"); ?> //call jquery from wordpress source
<?php wp_head(); ?> //then call head. put all script below
<script type="text/javascript" src="<?php bloginfo( 'template_url' ); ?>YOURSCRIPT"></script>//now call your script
in the script:
replace: $(document).ready(function() {
with:jQuery(document).ready(function($) {
then throughout the rest of the script replace all "$" with "jQuery"
that should work.