Skip to content

Commit

Permalink
Step 2.2: Customize product detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
yanickouellet committed Apr 29, 2016
1 parent 4cb5515 commit 440286e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions single-product.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

get_header(); ?>

<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
$id = get_the_ID();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->

<?php twentysixteen_post_thumbnail(); ?>

<div class="entry-content">
<?php
the_content();
?>
</div>
<div>
price: <strong><?php echo get_post_meta($id, 'price')[0]; ?>$</strong> <br />
inventory: <strong><?php echo get_post_meta($id, 'inventory')[0]; ?> left</strong>
</div>

<div class="snipcart-button-wrapper">
</article>
<?php
// End of the loop.
endwhile;
?>

</main><!-- .site-main -->

<?php get_sidebar( 'content-bottom' ); ?>

</div><!-- .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

0 comments on commit 440286e

Please sign in to comment.