title: Inject PHP with jquery, ajax
body: <p>I'm trying to inject PHP into a div element on a wordpress blog page. I've got it to work with static content, but my script won't load PHP. My dynamic/PHP code:</p>
  
  <pre><code>&lt;?php // data.php
      $args = array( 'numberposts' =&gt; 1, 'category' =&gt; 4, 'orderby' =&gt; 'rand' );
      $postslist = get_posts( $args );
      // Get posts associated with category 4
       foreach ($postslist as $post) :  setup_postdata($post); ?&gt; 
            &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
                &lt;?php 
                    global $more; 
                     $more=0;
                     the_content('read more');
                 ?&gt; 
   &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>And my ajax call:</p>
  
  <pre><code>(function($) {
    $("div#content-here").click(function(){
    var url = '/wp-content/themes/elevenchild/data.php';
  
    $("div#content-here").load(url);
  });
  })( jQuery );   
  </code></pre>
  
  <p>Naturally my view has a</p>
  
  <pre><code>&lt;div id="content-here"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>element.</p>
  
  <p>My jquery library is loaded fine. I can inject simple HTML, so my method works, it just doesn't work with PHP? In the console it reports 500 Internal Server Error. </p>
  
  <p>help</p>