Woocommerce Featured Products

<h2 class=”head”>Featured Products</h2>

$args = array(
‘post_type’ => ‘product’,
‘meta_key’ => ‘_featured’,
‘meta_value’ => ‘yes’,
‘posts_per_page’ => 3
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
/* print_r($loop->post);
echo $loop->post->ID;
exit; */
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($loop->post->ID, array(400,300) ));
$price = get_post_meta( $loop->post->ID, ‘_regular_price’, true);
$sale = get_post_meta( $loop->post->ID, ‘_sale_price’, true);
global $product;

href=”<?php the_permalink(); ?>”>

<img src=”<?php echo $thumbnail[0]; ?>” alt=””/>

<p class=”title”><?php echo $loop->post->post_title;?></p>
<div class=”price1″>
<span class=”actual”><?php echo get_woocommerce_currency_symbol().$price; ?></span>



Published by


I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s