title: Wordpress : list posts from category with AJAX and call plugin on it
body: <p>I'm currently trying to list all posts from a category in Wordpress.
  So my category template is just a part of html (ul > li wich go into the loop), and I call them in the front page naively with :</p>
  
  <pre><code>$(document).ready(function(){
      $.ajaxSetup({cache:true});
      $("#listCat a").click(function(){
          var href = $(this).attr("href");
          $("#projectContainer").html("Chargement...");
          $("#projectContainer").load(href,function(){
              $('#slider').jcarousel({
              wrap: 'circular'
  
                      });
              $('.jcarousel-prev').jcarouselControl({
                  target: '-=1'
              });
  
              $('.jcarousel-next').jcarouselControl({
                  target: '+=1'           
              });
          });
          return false;
      });
  });
  </code></pre>
  
  <p>Now, I need to call jcarousel plugin on element that I called with the AJAX thing (as you can see on the code). I thought calling it on a callback function would work, but no. The console logs out : </p>
  
  <pre><code>Uncaught TypeError: Cannot call method 'index' of null
  </code></pre>
  
  <p>It says this error comes from : jcarousel core plugin : <a href="https://github.com/jsor/jcarousel/blob/master/src/core_plugin.js" rel="nofollow">https://github.com/jsor/jcarousel/blob/master/src/core_plugin.js</a> . As if it can't find the children of the #slider element... I tried numerous way to do that (with $.get(), and so on..). Note that the $('#slider').jcarousel(); kinda worked : it adds data-jcarousel="true" attribute to the element.</p>
  
  <p>I guess I'm missing something obvious, I'm not sure I can do it that way but... Any help ?</p>