Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul class="products">
- <?php
- $args = array(
- 'post_type' => 'product',
- 'post_status' => 'publish',
- 'meta_query' => array(
- array(
- 'key' => '_visibility',
- 'value' => array('catalog', 'visible'),
- 'compare' => 'IN'
- )
- ),
- 'tax_query' => array(
- array(
- 'taxonomy' => 'product_cat',
- 'terms' => 'permanent',
- 'field' => 'slug',
- 'operator' => 'IN'
- )
- )
- );
- $loop = new WP_Query( $args );
- while ( $loop->have_posts() ) : $loop->the_post(); global $product;
- if (!$product->is_visible()) continue;
- $woocommerce_loop['loop']++;?>
- <li class="product">
- <a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
- <?php woocommerce_show_product_sale_flash( $post, $product ); ?>
- <?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="'.$woocommerce->get_image_size('shop_catalog_image_width').'px" height="'.$woocommerce->get_image_size('shop_catalog_image_height').'px" />'; ?>
- <h3><?php the_title(); ?></h3>
- </a>
- <a href="<?php echo get_permalink($product->id); ?>" ><?php echo apply_filters('out_of_stock_add_to_cart_text', __('details', 'woocommerce')); ?></a> /
- <a href="<?php echo esc_url( $product->add_to_cart_url() ); ?>" ><?php echo apply_filters('add_to_cart_text', __('Buy Now >>', 'woocommerce')); ?></a>
- </li>
- <?php endwhile; ?>
- </ul><!--/.products-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement