title: jQuery with PHP in Wordpress
body: <p>I am trying to add a jQuery animation into my Wordpress posts.</p>
  
  <p>The animation works fine, but what is hard is how to do it for each individual post. Meaning, each post is assigned a separate ID (e.g. <code>post-xxxx</code>) and the only way of knowing the post ID (that I know of) is through Wordpress' <code>the_ID()</code> function. </p>
  
  <p>I have my jQuery running in script tags in the index PHP file. How would I go about doing this? My only good idea was to add an <code>onclick</code> HTML listener to the <code>DIV</code> tag for the post and then use the <code>this</code> reference in the jQuery code but it never executed (not sure if my code was wrong).</p>
  
  <p>Here is the code for that thing I tried:</p>
  
  <pre><code>&lt;script&gt;
      function('test') {
          $(this).animate({
              height: '+=350'
          }, {
              duration: 500
          });
  
          $('.review-thumb').animate({
              opacity: 0
          }, {
              duration: 500
          });
      },
  &lt;/script&gt;
  </code></pre>
  
  <p>With this being my HTML tag:</p>
  
  
  
  <pre><code>&lt;div onclick="test" class="post number-&lt;?php echo $number; ?&gt; colour-&lt;?php echo $colour; ?&gt;" id="post-&lt;?php the_ID(); ?&gt;"&gt;
  </code></pre>
  
  <p>The website theme can be found at <a href="http://vusavusa.com/blog/?theme=vusavusa2" rel="nofollow">http://vusavusa.com/blog/?theme=vusavusa2</a>. Please excuse the messiness of content right now. </p>