title: Getting an empty AJAX response from wordpress function
body: <p>I'm getting an empty AJAX response from my function in my <code>functions.php</code>. Here's my function that processes the AJAX request.</p>
  
  <pre><code>function dynamic_date() {
  check_ajax_referer('dynamic_date_nonce');
  $fdate = $_GET['my_date'];
  $date[] = explode("-",$fdate);
  $year = $date[0];
  $month = $date[1];
  $args = array('year' =&gt; $year,'monthnum' =&gt; $month);
  $loop = new WP_Query($args);
  if($loop-&gt;have_posts()) { 
  while($loop-&gt;have_posts()) { 
  the_post();
  echo get_template_part( 'content', get_post_format() );
  } 
  } wp_reset_query();
  die('');
  }
  </code></pre>
  
  <p>And this is the AJAX call:</p>
  
  <pre><code>function _do_ajax(obj) {
      var element = $(obj); //our link object
      var url = wpAjax.unserialize(element.attr('href'));
      var s = {};
      s.response = 'ajax-response';
      s.type = "GET";
      s.url = sortbydate.ajax_url;
      s.dataType = "HTML";
      s.data = $.extend(s.data, { action: url.action, _ajax_nonce: url._wpnonce, my_date: url.my_date });
      s.global = false;
      s.timeout = 30000;
      s.success = function(data) {
          $("body.blog #content").fadeIn(500).append(data);
          alert(data);            
      } //End success
      s.error = function(r) {
          alert("Epic Fail!");    
      }
      $.ajax(s);
  } //end _do_ajax
  $.get_my_comments.init();
  });
  </code></pre>
  
  <p>Now if I remove the wordpress loop and just echo $year and $month it appends to the container and works fine. When I add the loop though I get an empty response and nothing is displayed.</p>
  
  <p>Am I handling the response properly?</p>