<?php } ?> </h3> <?php if (is_home()) { echo '<span class="view-more">' . __('View products', 'woothemes') . '</span>'; } ?> <?php /** * woocommerce_after_subcategory_title hook */ do_action('woocommerce_after_subcategory_title', $category); ?> <?php if (is_home() && $category->description !== '') { echo '<div class="description">' . superstore_truncate($category->description, 20) . '</div>'; } ?> </a> <?php do_action('woocommerce_after_subcategory', $category); ?> </li>
function widget($args, $instance) { $instance = $this->woo_enforce_defaults($instance); extract($args, EXTR_SKIP); extract($instance, EXTR_SKIP); echo $before_widget; global $loop, $woocommerce; $i = 1; $args = array('post_type' => 'product', 'posts_per_page' => apply_filters('products_per_page', $products_per_page, $instance, $this->id_base), 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'), array('key' => '_featured', 'value' => 'yes'))); echo '<ul class="products featured">'; $loop = new WP_Query($args); if (function_exists('get_product')) { $product = get_product($loop->post->ID); } else { $product = new WC_Product($loop->post->ID); } while ($loop->have_posts()) { $loop->the_post(); $product; ?> <li class="product featured <?php if ($i % 2 == 0) { echo 'last'; } else { echo 'first'; } ?> "> <?php do_action('woocommerce_before_shop_loop_item'); ?> <a href="<?php the_permalink(); ?> "> <?php do_action('woocommerce_before_shop_loop_item_title'); ?> <h3><?php the_title(); ?> </h3> </a> <?php echo '<div class="excerpt">' . superstore_truncate(get_the_excerpt(), 11) . '</div>'; do_action('woocommerce_after_shop_loop_item_title'); do_action('woocommerce_after_shop_loop_item'); ?> </li> <?php $i++; } echo '</ul>'; echo $after_widget; }