title: WORDPRESS how i can use AJAX to get POSTS
body: <p>wordpress in loop.php I have three inputs type radio:
   1-filter posts  by date
   2-filter by count views
   3-filter by comments</p>
  
  <p>how i can use ajax to get these filters?</p>
  
  <p>this is my code </p>
  
  <pre><code>&lt;div class="filter"&gt;
     &lt;form action="#" id="form-filter"&gt;
            &lt;input type="radio" id ="listing-1" name="filters" value="recents" checked&gt;&lt;label for="listing-1"&gt;the must recent&lt;/label&gt;
            &lt;input type="radio" id ="listing-2" name="filters" value="views"&gt;&lt;label for="listing-2"&gt;the must views&lt;/label&gt;
            &lt;input type="radio" id ="listing-3"  name="filters" value="comments"&gt;&lt;label for="listing-3"&gt;the must comments&lt;/label&gt;
        &lt;/form&gt;
  &lt;/div&gt;    
  </code></pre>
  
  <p>and this is the code php</p>
  
  <pre><code>if ( have_posts() ) {
     while ( have_posts() ) {
         the_post(); 
  
         //the_post_thumbnail
         // Post Content here
  
  
     } // end while
    } // end if
  </code></pre>
  
  <p>thanks</p>