Last active
December 26, 2015 21:08
-
-
Save chrdesigner/7213413 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $query_args = array( | |
| 'post_type' => 'product', | |
| 'product_cat' => SLUG-YOUR-CATEGORY, | |
| 'post_status' => 'publish', | |
| 'ignore_sticky_posts' => 1, | |
| 'posts_per_page' => 3, | |
| 'meta_query' => array( | |
| array( | |
| 'key' => '_visibility', | |
| 'value' => array('catalog', 'visible'), | |
| 'compare' => 'IN' | |
| ), | |
| array( | |
| 'key' => '_featured', | |
| 'value' => 'yes' | |
| ) | |
| ) | |
| ); | |
| $loop_featured = new WP_Query($query_args); if ($loop_featured->have_posts()) : ?> | |
| <header class="entry-header text-center"> | |
| <h1 class="entry-title">BEST SELLERS</h1> | |
| </header> | |
| <div class="entry-content"> | |
| <ul class="large-block-grid-3 small-block-grid-2"> | |
| <?php while ($loop_featured->have_posts()) : $loop_featured->the_post(); ?> | |
| <li class="featured-item text-center"> | |
| <a href="<?php echo get_permalink(get_the_ID()); ?>"> | |
| <div class="featured_item_image"><?php the_post_thumbnail('large'); ?></div> | |
| <h3><?php the_title(); ?></h3> | |
| <div class="featured_item_cats"> | |
| <?php echo strip_tags ( get_the_term_list( get_the_ID(), 'featured_item_category', "",", " ) );?> | |
| </div> | |
| <div class="tx-div small"></div> | |
| </a> | |
| </li> | |
| <?php endwhile; ?> | |
| </ul> | |
| </div> | |
| <?php endif; wp_reset_query();?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment