How are you referencing your CSS and JS? It sounds like your theme is missing the wp_head() and wp_footer() components.
Thread Starter
Cat
(@stitchyrocks)
Hmm. Ok. I accidentally deleted wp_head() from header.php (but I did have the footer although that didn’t have any js references). I have since moved all of my own js references to the footer.
Anyway, I’m noticing something weird. The header is pointing to a jquery file that’s on my server (which I’m assuming is triggered by something in one of my plugins. I also included a jquery file (same version) but one that is using the link from Google (in the footer). When I take out the one from Google in the footer, however, it seems like jQuery is not working at all. I think this redundancy is causing some problems in EDD and my other plug-ins. Do you know why? And how do I remedy this?
Thanks so much for your tiem.
Can you show me how you are loading your JS? It sounds like there is a JS conflict.
Make sure that you add wp_head() back in.
It’s also really not advisable that you load jQuery from Google, as it can cause a lot of unforseen problems.
Thread Starter
Cat
(@stitchyrocks)
Now I’m loading it in functions.php per instructions from this page:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Using this snippet:
<?php
function my_scripts_method() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
?>
Is that ok?
It’s okay, though I’d still not advise it. This is best:
function my_scripts_method() {
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');