
Product Grid Page
By:
alchymyth on
Nov 16th, 2012 | syntax:
PHP | size: 0.77 KB | hits: 23 | expires: Never
<?php
/**
* Template Name: Product Grid Page
*
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php $args = array(
'posts_per_page' => 6,
'category_name' => 'products',
'paged' => get_query_var('paged')
);
$product_posts = new WP_Query( $args );
if( $product_posts->have_posts() ) :
while ( $product_posts->have_posts() ) : $product_posts->the_post(); ?>
<div class="product grid">
<?php the_post_thumbnail('thumbnail');//add here what you want to output per post/product// ?>
</div><!-- .product -->
<?php endwhile; // end of the loop.
endif; wp_reset_postdata(); ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>