Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing JQuery with Wordpress the Right Way?
    primarykey
    data
    text
    <p>I've been messing around with my custom(not a plugin) jquery slide for Wordpress. I've been searching the whole day for how to integrate javascript in Wordpress but seem to come across many different ways. So my main question is which way is the proper, fastest way to code the script.</p> <p>From what I read it looks like I should use Wordpress enqueue so that the script is only called on the page it is needed on which in my case is the index.php. But I am not sure of the proper way to do it. Also, should I add something to my functions.php?</p> <p>Here is the script:</p> <pre><code>&lt;script src="Js/js/jquery-1.6.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Js/js/jquery.zaccordion.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#example4 ul").zAccordion({ slideWidth: 600, width: 900, height: 250, timeout: 5000, slideClass: "frame" }); }); &lt;/script&gt; </code></pre> <p>And this is what I have now in my header.php:</p> <pre><code>&lt;?php wp_enqueue_script('jquery'); ?&gt; &lt;?php wp_head();?&gt; &lt;script type="text/javascript" src="&lt;?php bloginfo("template_url"); ?&gt;/js/jquery-1.6.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.zaccordion.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery.noConflict(); jQuery(document).ready(function() { jQuery("#slider ul").zAccordion({ slideWidth: 600, width: 800, height: 250, timeout: 5000, slideClass: "frame" }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload