Created
October 2, 2014 02:31
-
-
Save trevorgreenleaf/43307f89f049d9f66e69 to your computer and use it in GitHub Desktop.
Products Page
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 get_header(); | |
/* | |
Template Name: Product Page | |
*/ | |
?> | |
<div class="col-xs-12"> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
<h1><?php the_title(); ?></h1> | |
<?php the_content(); ?> | |
<?php endwhile; endif; ?> | |
<?php | |
$args = array( | |
'post_type' => 'product', | |
'orderby' => 'title', | |
'order' => 'ASC' | |
); | |
$query_products = new WP_Query( $args ); ?> | |
<?php if ($query_products->have_posts()) : while ($query_products->have_posts()) : $query_products->the_post(); ?> | |
<div class="well"> | |
<h1><?php the_title(); ?></h1> | |
<a href="<?php the_permalink(); ?>" class="btn btn-primary btn-lg">View</a> | |
</div> | |
<?php endwhile; endif; ?> | |
</div> | |
</div> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment