single-product.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * The Template for displaying all single products
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/single-product.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @author WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 1.6.4
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit; // Exit if accessed directly
  20. }
  21. get_header( 'shop' ); ?>
  22. <?php
  23. /**
  24. * woocommerce_before_main_content hook.
  25. *
  26. * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
  27. * @hooked woocommerce_breadcrumb - 20
  28. */
  29. do_action( 'woocommerce_before_main_content' );
  30. ?>
  31. <?php while ( have_posts() ) : the_post(); ?>
  32. <?php wc_get_template_part( 'content', 'single-product' ); ?>
  33. <?php endwhile; // end of the loop. ?>
  34. <?php
  35. /**
  36. * woocommerce_after_main_content hook.
  37. *
  38. * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
  39. */
  40. do_action( 'woocommerce_after_main_content' );
  41. ?>
  42. <?php
  43. /**
  44. * woocommerce_sidebar hook.
  45. *
  46. * @hooked woocommerce_get_sidebar - 10
  47. */
  48. do_action( 'woocommerce_sidebar' );
  49. ?>
  50. <?php get_footer( 'shop' );
  51. /* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */