Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.54 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(); ?>
  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.            
  41.  
  42.         <?php endif; ?>
  43. <?php
  44.             /**
  45.              * woocommerce_archive_description hook.
  46.              *
  47.              * @hooked woocommerce_taxonomy_archive_description - 10
  48.              * @hooked woocommerce_product_archive_description - 10
  49.              */
  50.             do_action( 'woocommerce_archive_description' );
  51.         ?>
  52.  
  53.        
  54.  
  55.     </header>
  56.  
  57.         <?php if ( have_posts() ) : ?>
  58.            
  59.             <div class="shop-filters">
  60.                 <?php
  61.                     /**
  62.                      * woocommerce_before_shop_loop hook.
  63.                      *
  64.                      * @hooked woocommerce_result_count - 20
  65.                      * @hooked woocommerce_catalog_ordering - 30
  66.                      */
  67.                     do_action( 'woocommerce_before_shop_loop' );
  68.                 ?>
  69.             </div>
  70.  
  71.             <?php woocommerce_product_loop_start(); ?>
  72.  
  73.                 <?php woocommerce_product_subcategories(); ?>
  74.  
  75.                 <?php while ( have_posts() ) : the_post(); ?>
  76.  
  77.                     <?php
  78.                         /**
  79.                          * woocommerce_shop_loop hook.
  80.                          *
  81.                          * @hooked WC_Structured_Data::generate_product_data() - 10
  82.                          */
  83.                         do_action( 'woocommerce_shop_loop' );
  84.                     ?>
  85.  
  86.                     <?php wc_get_template_part( 'content', 'product' ); ?>
  87.  
  88.                 <?php endwhile; // end of the loop. ?>
  89.  
  90.             <?php woocommerce_product_loop_end(); ?>
  91.  
  92.             <?php
  93.                 /**
  94.                  * woocommerce_after_shop_loop hook.
  95.                  *
  96.                  * @hooked woocommerce_pagination - 10
  97.                  */
  98.                 do_action( 'woocommerce_after_shop_loop' );
  99.             ?>
  100.  
  101.         <?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
  102.  
  103.             <?php
  104.                 // WC < 2.7 backward compatibility
  105.                
  106.                 if( version_compare( WC_VERSION, '2.7', '<' ) ){
  107.                    
  108.                     wc_get_template( 'loop/no-products-found.php' );
  109.                    
  110.                 } else {
  111.                    
  112.                     /**
  113.                      * woocommerce_no_products_found hook.
  114.                      *
  115.                      * @hooked wc_no_products_found - 10
  116.                      */
  117.                     do_action( 'woocommerce_no_products_found' );
  118.                    
  119.                 }
  120.             ?>
  121.  
  122.         <?php endif; ?>
  123.  
  124.     <?php
  125.         /**
  126.          * woocommerce_after_main_content hook.
  127.          *
  128.          * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
  129.          */
  130.         do_action( 'woocommerce_after_main_content' );
  131.     ?>
  132.  
  133.     <?php
  134.         /**
  135.          * woocommerce_sidebar hook.
  136.          *
  137.          * @hooked woocommerce_get_sidebar - 10
  138.          */
  139.         do_action( 'woocommerce_sidebar' );
  140.     ?>
  141.  
  142. <?php get_footer( 'shop' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement