Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.20 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Template for displaying product archives, including the main shop page which is a post type archive
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/archive-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 2.0.0
  17. */
  18.  
  19. if ( ! defined( ‘ABSPATH’ ) ) {
  20. exit; // Exit if accessed directly
  21. }
  22.  
  23. get_header( ‘shop’ ); ?>
  24.  
  25. <?php
  26. /**
  27. * woocommerce_before_main_content hook.
  28. *
  29. * @hooked woocommerce_output_content_wrapper – 10 (outputs opening divs for the content)
  30. * @hooked woocommerce_breadcrumb – 20
  31. * @hooked WC_Structured_Data::generate_website_data() – 30
  32. */
  33. do_action( ‘woocommerce_before_main_content’ );
  34. ?>
  35.  
  36. <header class=”woocommerce-products-header”>
  37.  
  38. <?php if ( apply_filters( ‘woocommerce_show_page_title’, true ) ) : ?>
  39.  
  40. <h1 class=”woocommerce-products-header__title page-title”><?php woocommerce_page_title(); ?></h1>
  41.  
  42. <?php endif; ?>
  43.  
  44. <?php
  45. /**
  46. * woocommerce_archive_description hook.
  47. *
  48. * @hooked woocommerce_taxonomy_archive_description – 10
  49. * @hooked woocommerce_product_archive_description – 10
  50. */
  51. do_action( ‘woocommerce_archive_description’ );
  52. ?>
  53.  
  54. </header>
  55.  
  56. <?php if ( have_posts() ) : ?>
  57.  
  58. <?php
  59. /**
  60. * woocommerce_before_shop_loop hook.
  61. *
  62. * @hooked wc_print_notices – 10
  63. * @hooked woocommerce_result_count – 20
  64. * @hooked woocommerce_catalog_ordering – 30
  65. */
  66. do_action( ‘woocommerce_before_shop_loop’ );
  67. ?>
  68.  
  69. <?php woocommerce_product_loop_start(); ?>
  70.  
  71. <?php woocommerce_product_subcategories(); ?>
  72.  
  73. <?php while ( have_posts() ) : the_post(); ?>
  74.  
  75. <?php
  76. /**
  77. * woocommerce_shop_loop hook.
  78. *
  79. * @hooked WC_Structured_Data::generate_product_data() – 10
  80. */
  81. do_action( ‘woocommerce_shop_loop’ );
  82. ?>
  83.  
  84. <?php wc_get_template_part( ‘content’, ‘product’ ); ?>
  85.  
  86. <?php endwhile; // end of the loop. ?>
  87.  
  88. <?php woocommerce_product_loop_end(); ?>
  89.  
  90. <?php
  91. /**
  92. * woocommerce_after_shop_loop hook.
  93. *
  94. * @hooked woocommerce_pagination – 10
  95. */
  96. do_action( ‘woocommerce_after_shop_loop’ );
  97. ?>
  98.  
  99. <?php elseif ( ! woocommerce_product_subcategories( array( ‘before’ => woocommerce_product_loop_start( false ), ‘after’ => woocommerce_product_loop_end( false ) ) ) ) : ?>
  100.  
  101. <?php
  102. /**
  103. * woocommerce_no_products_found hook.
  104. *
  105. * @hooked wc_no_products_found – 10
  106. */
  107. do_action( ‘woocommerce_no_products_found’ );
  108. ?>
  109.  
  110. <?php endif; ?>
  111.  
  112. <?php
  113. /**
  114. * woocommerce_after_main_content hook.
  115. *
  116. * @hooked woocommerce_output_content_wrapper_end – 10 (outputs closing divs for the content)
  117. */
  118. do_action( ‘woocommerce_after_main_content’ );
  119. ?>
  120.  
  121. <?php
  122. /**
  123. * woocommerce_sidebar hook.
  124. *
  125. * @hooked woocommerce_get_sidebar – 10
  126. */
  127. do_action( ‘woocommerce_sidebar’ );
  128. ?>
  129.  
  130. <?php get_footer( ‘shop’ ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement