Created
March 25, 2017 18:50
-
-
Save territutich/e4de16d3fc1b5ac4c8aa78cddcd20877 to your computer and use it in GitHub Desktop.
Woo 2 featured products two column
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
<?php if ( $homepage_query->have_posts() ) : ?> | |
<?php $counter=1; ?> | |
<?php while ( $homepage_query->have_posts() ) : $homepage_query->the_post(); ?> | |
<?php if (!$counter%2==0) { ?> | |
<div class="product row"> | |
<div class="product-image col-xs-12 col-md-6 col-md-push-6"> | |
<?php the_post_thumbnail(); ?> | |
</div><!-- .product-image --> | |
<div class="product-desc col-xs-12 col-md-6 col-md-pull-6"> | |
<h3><a href="<?php echo get_permalink( $homepage_query->post->ID ) ?>"><?php the_title(); ?></a></h3> | |
<?php the_content(); ?> | |
<p style="text-align:center;"><?php echo $counter; ?>,<?php echo $counter%2; ?><br><a class="buybtn" href="<?php echo get_permalink( $homepage_query->post->ID ) ?>">Add to Cart</a></p> | |
</div><!-- .product-desc --> | |
</div><!-- .product --> | |
<?php $counter++; } elseif ($counter%2==0) { ?> | |
<div class="product row"> | |
<div class="product-image col-xs-12 col-md-6"> | |
<?php the_post_thumbnail(); ?> | |
</div><!-- .product-image --> | |
<div class="product-desc col-xs-12 col-md-6"> | |
<h3><a href="<?php echo get_permalink( $homepage_query->post->ID ) ?>"><?php the_title(); ?></a></h3> | |
<?php the_content(); ?> | |
<p style="text-align:center;"><?php echo $counter; ?>,<?php echo $counter%2; ?><br><a class="buybtn" href="<?php echo get_permalink( $homepage_query->post->ID ) ?>">Add to Cart</a></p> | |
</div><!-- .product-desc --> | |
</div><!-- .product --> | |
<?php $counter++; } ?> | |
<?php endwhile; wp_reset_query(); endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment