Skip to content

Instantly share code, notes, and snippets.

@dompascal
Created December 5, 2013 19:04
Show Gist options
  • Select an option

  • Save dompascal/7811264 to your computer and use it in GitHub Desktop.

Select an option

Save dompascal/7811264 to your computer and use it in GitHub Desktop.
Woocommerce Single Product Template
<?php
/**
* The Template for displaying all single products.
*
* Override this template by copying it to yourtheme/woocommerce/single-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
get_header('shop'); ?>
<?php
/**
* woocommerce_before_main_content hook
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
*/
do_action('woocommerce_before_main_content');
?>
<!-- left -->
<div class="left">
<?php while ( have_posts() ) : the_post(); ?>
<?php woocommerce_get_template_part( 'content', 'single-product' ); ?>
<?php endwhile; // end of the loop. ?>
</div>
<!-- end left -->
<?php if (! is_mobile() ) : ?>
<!-- right -->
<div class="right">
<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action('woocommerce_sidebar');
?>
</div>
<!-- end right -->
<?php endif; ?>
<?php
/**
* woocommerce_after_main_content hook
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action('woocommerce_after_main_content');
?>
<div class="clear"></div>
<?php get_footer('shop'); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment