title: Show first image gallery product woocommerce
body: <p>I'm having some problems trying to show the first image of a gallery product on woocommerce,</p>
  
  <p>I´m working on a personal wordpress theme, with personal template, all this work is into an owl carousel to show every product on a different slide,</p>
  
  <p>I´m new with Woocommerce, I´m using WP_Query to show the products of a category, inside I´m showing the_title, the_content, the_permalink of every product on a while, I want to show the first and only one image inside the gallery of every product but I don´t know how to reach to it:</p>
  
  <pre><code>&lt;div class="owl-carousel owl-theme" id="carousel"&gt;
          &lt;?php 
            $params = array(
              'post_type'             =&gt; 'product',
              'post_status'           =&gt; 'publish',
              'posts_per_page'        =&gt; '-1',
              'product_cat'           =&gt; 'barras'
            );
  
            $wc_query = new WP_Query($params);
            if ($wc_query-&gt;have_posts()) :
              while ($wc_query-&gt;have_posts()) :
                $wc_query-&gt;the_post();
                ?&gt;
                &lt;div class="item"&gt;
                  &lt;a href="&lt;?php the_permalink();?&gt;"&gt;
                    &lt;a href="javascript:void(0)" class="prev"&gt;&lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/assets/img/prev.png" alt=""&gt;&lt;/a&gt;
                    &lt;a href="javascript:void(0)" class="next"&gt;&lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/assets/img/next.png" alt=""&gt;&lt;/a&gt;
                    &lt;p class="titulo-producto-slider"&gt;&lt;?php the_title(); ?&gt;&lt;/p&gt;
                  &lt;/a&gt;
                  &lt;div class="espacio-10"&gt;&lt;/div&gt;
                  &lt;div class="descripcion-producto-slider"&gt;
                    &lt;?php the_content(); ?&gt;
                  &lt;/div&gt;
                  &lt;div class="ver-detalle"&gt;
                    &lt;ul&gt;
                      &lt;li&gt;
                        &lt;a href="&lt;?php the_permalink();?&gt;"&gt;Ver detalles&lt;/a&gt;
                      &lt;/li&gt;
                    &lt;/ul&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
            &lt;?php
              endwhile;
                wp_reset_postdata();
            else:  ?&gt;
              &lt;p&gt;&lt;?php _e( 'No Products' );?&gt;&lt;/p&gt; 
            &lt;?php endif;
          ?&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>Sorry if you don´t understand something, it is my first question on stack and I don´t speak English,</p>
  
  <p>Thanks a lot,</p>