Tutorial :jQuery and Wordpress



Question:

Would anyone know how to get the jQuery api going with Wordpress? I know that you can add an action in the functions template but this particular theme template isn't letting me add it.


Solution:1

The easiest way to add jQuery is to use the Google Ajax libs API

<script src="http://www.google.com/jsapi"></script>  <script>    google.load("jquery", "1");  </script>  

Add these lines in the <head> section of your main template page, and you should be able to use jQuery right away.

(I believe this would require you to have FTP access to your blog or at least access to the theme-editor such that you can edit the main PHP theme pages themselves)


Solution:2

What kind of errors are you seeing? Are you also calling <?php wp_head(); ?> in the header? Are you also linking < wp_enqueue_script('jquery'); ?> , which also loads jquery?


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »