title: Get all Posts If has same custom field values in Posts
body: <p>Trying to get all the posts having the same zipcode as metavalue. Thanks in advance for the help.</p>
  
  <pre><code>&lt;?php
                   $query = new WP_Query( array(
                           'post_type'=&gt; array('service'),
                           'posts_per_page' =&gt; -1,
                           'meta_query' =&gt; array( array(
                                'key'=&gt; 'zipcode',
                                'value'=&gt; ','.$zip.',',
                                'compare'=&gt; 'LIKE'
                               ) )
                           ));                 
  ?&gt;      
  
      &lt;?php if ( $query-&gt;have_posts() ) :while ( $query-&gt;have_posts() ) : $query-&gt;the_post();  ?&gt;
             &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
      &lt;?php endwhile; // end of the loop. ?&gt;
      &lt;?php wp_reset_query(); ?&gt;
      &lt;?php else: ?&gt;
            No results found.
      &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>zipcode are numbers for example <code>12345</code>. If posts have value <code>12345</code> in the custom field. then it should display all posts which have the <code>12345</code> value. The above code is working fine but displays only one post.</p>