php – Display product gallery with product on featured-ThrowExceptions

Exception or error:

after a lot of searching on google i didn’t find a solution.

I would like to display my product with your gallery by switching the main images when you click on the gallery image

enter image description here

<ul class="products">
        $args = array(
            'post_type' => 'product',
            'posts_per_page' => 12
        $loop = new WP_Query( $args );
        if ( $loop->have_posts() ) {
            while ( $loop->have_posts() ) : $loop->the_post();
                wc_get_template_part( 'content', 'product' );
        } else {
            echo __( 'No products found' );

with this code I can display all the products but without the photo gallery.

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *