Home › Support Forums › Theme Support › Enlightenment › Woo product post type-add thumbnail/cart button in home page custom query widget › Reply To: Woo product post type-add thumbnail/cart button in home page custom query widget
Thanks, I already did that part to make the woo pages compatible but when using the product post type in a widget custom query, only the title and description are pulled in. What I’d like to show also are the thumbnail, price and add to cart button. In other words, to make it look like a woo category/archive page.
What I add in other themes is the following but I’d prefer to utilize the custom query option in Enlightenment, if possible. I just don’t see where to alter the query:
`<ul class=”products”>
<?php
$args = array( ‘post_type’ => ‘product’, ‘stock’ => 1, ‘posts_per_page’ => 5, ‘meta_key’ => ‘_featured’, ‘meta_value’ => ‘yes’ );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<li class=”product type-product status-publish featured”>
<a id=”id-<?php the_id(); ?>” href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”>
<h3><?php the_title(); ?></h3>
<div class=”prod-top”></div>
<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, ‘shop_catalog’); else echo ‘<img src=”‘.woocommerce_placeholder_img_src().'” alt=”Placeholder” width=”65px” height=”115px” />’; ?>
<br />
<span class=”price”><?php echo $product->get_price_html(); ?></span>
</a>
<br />
<?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
</li><!– /span3 –>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>`