title: get_posts with ajax return nothing
body: <p>I'm trying to get a post by using <code>get_posts</code> with slug which received successfully from ajax. However, it returns nothing. Please point out my mistake.</p>
  
  <p>My ajax:</p>
  
  <pre><code>var nextt = document.getElementById("nextt");
  nextt.addEventListener("click",function(e){
      event.preventDefault();
      var nextpage = document.querySelector("a[rel=next]").getAttribute("href");
      xhr = new XMLHttpRequest();
      xhr.open('POST', ajaxurl, true);
      xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
      xhr.onreadystatechange  = function(){
          var content = document.getElementById('main');
          if(xhr.readyState  == 4){
              if(xhr.status  == 200) {
                  content.innerHTML = xhr.responseText;
              } else{
                  content.innerHTML = 'Cannot connect to server. Check your internet connection '}
          }
      };
      xhr.send('action=load_selanjutnya&amp;nonce=' + ajaxnonce + '&amp;value=' + nextpage);
  },false);
  </code></pre>
  
  <p>On my function.php</p>
  
  <pre><code>function nextpage(){
     global $post;
      print_r($_REQUEST);
      $slug = $_REQUEST['value'];
      $args=array(
          'name' =&gt; $slug,
          'post_type' =&gt; 'post',
          'post_status' =&gt; 'publish',
          'numberposts' =&gt; 1
      );
      $my_posts = get_posts( $args );
      if( $my_posts ) {
          foreach ($my_posts as $post)
              setup_postdata( $post );
              get_template_part( 'single-ajax', get_post_format() );
          wp_reset_postdata();
      }
      else {echo $slug . ' - Fail. '; var_dump($my_posts);}
      exit();
  }
  add_action( 'wp_ajax_nextpage', 'nextpage' );
  add_action( 'wp_ajax_nopriv_nextpage', 'nextpage' );
  </code></pre>
  
  <p>I expect it to load the content page instead of nothing/blank as return.</p>