Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement