Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. <?php the_field('desc'); ?>
  2.  
  3. <?php if($desc=get_field("desc")){echo $desc;}?>
  4.  
  5. <?php
  6. /**
  7. * The Template for displaying product archives, including the main shop page which is a post type archive.
  8. *
  9. * Override this template by copying it to yourtheme/woocommerce/archive-product.php
  10. *
  11. * @author WooThemes
  12. * @package WooCommerce/Templates
  13. * @version 2.0.0
  14. */
  15.  
  16. if ( ! defined( 'ABSPATH' ) ) {
  17. exit; // Exit if accessed directly
  18. }
  19. global $zorka_data,$woocommerce_loop;
  20.  
  21. $archive_layout = isset($_GET['layout']) ? $_GET['layout'] : '' ;
  22. $layouts = array('full-content','left-sidebar','right-sidebar');
  23. if (!in_array($archive_layout,$layouts)) {
  24.  
  25. $cat = get_queried_object();
  26. if ($cat && property_exists( $cat, 'term_id' )) {
  27. $archive_layout = get_tax_meta( $cat,'zorka_custom_product_archive_layout');
  28. }
  29.  
  30. if (empty($archive_layout) || $archive_layout == 'none') {
  31. $archive_layout = $zorka_data['product-archive-layout'];
  32. }
  33. }
  34.  
  35. $archive_product_columns = isset($_GET['columns']) ? $_GET['columns'] : '';
  36. if (!in_array($archive_product_columns,array('2','3','4'))) {
  37. $archive_product_columns = isset($zorka_data['archive-product-columns']) ? $zorka_data['archive-product-columns'] : 3;
  38. }
  39.  
  40. $class_col = 'col-md-12';
  41.  
  42. if ($archive_layout == 'left-sidebar' || $archive_layout == 'right-sidebar' ){
  43. $class_col = 'col-md-9';
  44. }
  45. if ($archive_layout == 'left-sidebar') {
  46. $class_col .= ' col-md-push-3';
  47. }
  48. get_header();
  49. ?>
  50. <?php get_template_part('archive-product','top') ?>
  51. <main role="main" class="site-content-product-archive">
  52. <div class="container clearfix">
  53. <div class="row clearfix">
  54. <div class="<?php echo esc_attr($class_col); ?>">
  55. <div class="product-wrapper clearfix">
  56. <?php if ( have_posts() ) : ?>
  57. <div class="category-filter clearfix">
  58. <?php
  59. /**
  60. * woocommerce_before_shop_loop hook
  61. *
  62. * @hooked woocommerce_result_count - 20
  63. * @hooked woocommerce_catalog_ordering - 30
  64. */
  65. do_action( 'woocommerce_before_shop_loop' );
  66. ?>
  67. </div>
  68. <?php woocommerce_product_subcategories(array(
  69. 'before' => '<div class="product-cat-wrap clearfix">',
  70. 'after' => '</div>',
  71.  
  72. ));
  73. $woocommerce_loop['columns'] = $archive_product_columns; ?>
  74.  
  75. <?php woocommerce_product_loop_start(); ?>
  76.  
  77. <?php while ( have_posts() ) : the_post(); ?>
  78.  
  79. <?php wc_get_template_part( 'content', 'product' ); ?>
  80.  
  81. <?php endwhile; // end of the loop. ?>
  82.  
  83. <?php woocommerce_product_loop_end(); ?>
  84.  
  85. <?php
  86. /**
  87. * woocommerce_after_shop_loop hook
  88. *
  89. * @hooked woocommerce_pagination - 10
  90. */
  91. do_action( 'woocommerce_after_shop_loop' );
  92. ?>
  93.  
  94. <?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
  95. <?php wc_get_template( 'loop/no-products-found.php' ); ?>
  96. <?php endif; ?>
  97.  
  98.  
  99.  
  100.  
  101. <div><?php echo get_post_meta($post->ID, ' desc_acf ', true); ?></div>
  102.  
  103.  
  104.  
  105. </div>
  106. </div>
  107.  
  108. <?php
  109. if ($archive_layout == 'left-sidebar') {
  110. get_sidebar('shop-left');
  111. }
  112. if ($archive_layout == 'right-sidebar') {
  113. get_sidebar('shop');
  114. }
  115. ?>
  116. </div>
  117. </div>
  118. </main>
  119. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement