WordPress woocommerce product Select feature product to create carousel image

 

WordPress woocommerce product : script tutorial & download

Has Upload Feature image to upload and display on home page or single product page run the carousel gallery.


<div id="featured" class="carousel slide ">
<div class="carousel-inner ">
<?php
$args = array(
'post_type' => 'product',
'meta_key' => '_featured',
'meta_value' => 'yes',
'posts_per_page' => 6,
'post_status' => 'publish',
'offset' => 0,
'order' => 'DESC'
);
$featured_loop = new WP_Query( $args );
if ( $featured_loop->have_posts() ):
while ( $featured_loop->have_posts() ) : $featured_loop->the_post(); ?>

<div class="<?php echo 'item'; ?>">
<div class=" ">
<div class="thumbnail">
<i class="tag"></i>
<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php echo woocommerce_get_product_thumbnail(); ?>
</a>
</div>
<div class="panel-body text-center">
<h6><?php the_title(); ?> </h6>
</div>
</div>
</div>
<?php endwhile; ?>
<a class="left carousel-control" href="#featured" data-slide="prev"><i class="fa fa-arrow-left"></i></a>
<a class="right carousel-control" href="#featured" data-slide="next"><i class="fa fa-arrow-right"></i></a>
<?php wp_reset_postdata(); endif; ?>
</div>
</div>

 

 

Advertisement

No comments.

Leave a Reply