title: How to load Wordpress Taxonomy list and Post with Ajax onclick
body: <p>Sorry for the long read probably... </p>
  
  <p>I hope you guys can help me out. Im trying to display a taxonomy list that will load the content of that taxonomy in the same post as the main post page.</p>
  
  <p>I have been looking at this script, found on this website (<a href="https://stackoverflow.com/questions/15402239/how-to-load-wordpress-post-with-ajax-onclick">How to load Wordpress Post with Ajax onclick</a>).</p>
  
  <p>Javascript:</p>
  
  <pre><code>jQuery.noConflict();
  jQuery(document).ready(function($){
      $.ajaxSetup({cache:false});
      $("a.ajax").click(function(){
          var post_url = $(this).attr("href");
          var post_id = $(this).attr("rel");
          $("#tabs").html('&lt;div class="loading"&gt;loading...&lt;/div&gt;');
      $("#tabs").load(post_url);
      return false;
      });
  });
  </code></pre>
  
  <p>The page where I want to display the post content (I am using custom post types called "artwork":</p>
  
  <pre><code>&lt;ul class="container"&gt;
    &lt;?php query_posts('post_type=artwork&amp;posts_per_page=-1'); ?&gt;
    &lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;
    &lt;li class="mytab"&gt;
      &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
      &lt;a href="&lt;?php the_permalink(); ?&gt;" rel="&lt;?php the_ID(); ?&gt;" class="ajax"&gt;&lt;?php the_post_thumbnail('Project'); ?&gt;&lt;/a&gt;
    &lt;/li&gt;
    &lt;?php endwhile; endif; wp_reset_query(); ?&gt;
  &lt;/ul&gt;
  
  &lt;!-- LOAD SINGLE POST CONTENT IN #TABS --&gt;
  &lt;div id="tabs"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And the single post "single-artwork.php". Note: Dont use get_header or get_footer etc:</p>
  
  <pre><code>&lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;
    &lt;div class="tabcontent" id="tab-&lt;?php the_ID(); ?&gt;"&gt;
      &lt;?php the_content(); ?&gt;
    &lt;/div&gt;
  &lt;?php endwhile; endif; ?&gt;
  </code></pre>
  
  <p>Im not using the last part of the script because im already working in single-{slug}.php</p>
  
  <p>This actually opens the taxonomy content in the same window, just like i want. But this shows the thumbnail as a link.</p>
  
  <p>What i really want is to just have the taxonomy list which will then open en show the content in the #tabs div.</p>
  
  <p>So far i got this:</p>
  
  <pre><code>&lt;a href="&lt;?php the_permalink(); ?&gt;" rel="&lt;?php the_ID(); ?&gt;" class="ajax"&gt;&lt;?php echo get_the_term_list( $post-&gt;ID, 'inclusief'); ?&gt;&lt;/a&gt;
  </code></pre>
  
  <p>which shows the taxonomy list like i want. But this opens the content of that taxonomy on a new page and not in the #tabs. What is doing this... and why. And ofcourse how can i let this taxonomy content open in the #tabs div... </p>
  
  <p>Thanks!</p>