Last active
September 14, 2017 05:00
-
-
Save layoutph/9d786dfe8c4e15c1f56cd044e41d0b1c to your computer and use it in GitHub Desktop.
This file contains 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
<!-- This will loop and will show all products with a product category of freeshipping --> | |
<?php | |
$args = array( 'product_cat' => 'freeshipping', 'post_type' => 'product', 'posts_per_page' => 500, 'orderby' => 'rand' ); | |
$loop = new WP_Query( $args ); | |
while($loop->have_posts()) : $loop->the_post(); ?> | |
<div class='col-md-3 col-sm-4 col-xs-12' style="padding-bottom: 30px;"> | |
<a href="<?php echo esc_url( get_permalink() ); ?>"><img src='<?php echo get_the_post_thumbnail_url(); ?>' style="border-radius: 15px" class="img-responsive theimage" /> </a> | |
<center> | |
<h4> | |
<?php | |
$holdtitle = $product->post->post_title; | |
echo $holdtitle ; | |
?></h4> | |
<?php | |
global $product; | |
$price=$product->get_price_html(); | |
echo "<span style='color: #fff; font-weight: bold; font-size: 1em'>" . $price . "</span>"; | |
?> | |
<br /> | |
<a href="<?php echo esc_url( get_permalink() ); ?>" class="btn btn-danger" style="margin-top: 5px;"> VIEW </a> | |
</center> | |
</div> | |
<?php endwhile; ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment