title: How to Get Posts From Custom post type with WP Rest Api v1.2.5
body: <p>I want to get the posts from post type = events but it is not showing the correct posts from events post type but from the actual WP-POST</p>
  
  <pre><code>&lt;?php
  
       // Get the JSON
       $json = file_get_contents('http://coralgableschamber.org/wp-json/posts?filter[posts_per_page]=1&amp;filter[post_type]=events');
       // Convert the JSON to an array of posts
       $posts = json_decode($json);
      foreach ($posts as $p) {
        echo '&lt;p&gt;Title: ' . $p-&gt;title . '&lt;/p&gt;';
        echo '&lt;p&gt;Date:  ' . date('F jS', strtotime($p-&gt;date)) . '&lt;/p&gt;';
  // Output the featured image (if there is one)
        echo $p-&gt;featured_image ? '&lt;amp-img src="' . $p-&gt;featured_image-&gt;guid . '" width="150" height="110"&gt;&lt;/amp-img&gt;' : '';
  
        echo '&lt;p&gt;Content: ' . $p-&gt;content. '&lt;/p&gt;';    
  
     }
  </code></pre>
  
  <p>The event post type have the following posts in it but it is not showing these
  <a href="https://i.stack.imgur.com/kQnFa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kQnFa.png" alt="enter image description here"></a></p>
  
  <p><strong>It is showing wrong post check this link</strong>: <a href="http://mxcounters.com/coralgables/AMP/front.html" rel="nofollow noreferrer">http://mxcounters.com/coralgables/AMP/front.html</a></p>
  
  <p>What is wrong and how i can fix to make it work.</p>
  
  <p>Thanks!</p>