Guest User

Untitled

a guest
Jan 27th, 2016
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php get_header();
  2.  
  3. if(is_shop() || is_product_category() || is_product_tag()) {
  4.  
  5. //page header for main shop page
  6. nectar_page_header(woocommerce_get_page_id('shop'));
  7.  
  8. }
  9.  
  10. //change to 3 columsn per row when using sidebar
  11. if (!function_exists('loop_columns')) {
  12. function loop_columns() {
  13. return 3; // 3 products per row
  14. }
  15. }
  16.  
  17. ?>
  18.  
  19. <div class="container-wrap">
  20.  
  21. <div class="container main-content">
  22.  
  23. <div class="row">
  24.  
  25. <?php
  26.  
  27. if ( function_exists( 'yoast_breadcrumb' ) ){ yoast_breadcrumb('<p id="breadcrumbs">','</p>'); }
  28.  
  29. $options = get_nectar_theme_options();
  30.  
  31. $main_shop_layout = (!empty($options['main_shop_layout'])) ? $options['main_shop_layout'] : 'no-sidebar';
  32. $single_product_layout = (!empty($options['single_product_layout'])) ? $options['single_product_layout'] : 'no-sidebar';
  33.  
  34. //single product layout
  35. if(is_product()){
  36.  
  37. if($single_product_layout == 'right-sidebar' || $single_product_layout == 'left-sidebar'){
  38. add_filter('loop_shop_columns', 'loop_columns');
  39. }
  40.  
  41. switch($single_product_layout) {
  42. case 'no-sidebar':
  43. woocommerce_content();
  44. break;
  45. case 'right-sidebar':
  46.  
  47. echo '<div id="post-area" class="col span_9">';
  48. woocommerce_content();
  49. echo '</div><!--/span_9-->';
  50.  
  51. echo '<div id="sidebar" class="col span_3 col_last">';
  52. get_sidebar();
  53. echo '</div><!--/span_9-->';
  54.  
  55. break;
  56.  
  57. case 'left-sidebar':
  58. echo '<div id="sidebar" class="col span_3">';
  59. get_sidebar();
  60. echo '</div><!--/span_9-->';
  61.  
  62. echo '<div id="post-area" class="col span_9 col_last">';
  63. woocommerce_content();
  64. echo '</div><!--/span_9-->';
  65.  
  66. break;
  67. default:
  68. woocommerce_content();
  69. break;
  70. }
  71.  
  72. }
  73.  
  74. //Main Shop page layout
  75. elseif(is_shop() || is_product_category() || is_product_tag()) {
  76.  
  77. if($main_shop_layout == 'right-sidebar' || $main_shop_layout == 'left-sidebar'){
  78. add_filter('loop_shop_columns', 'loop_columns');
  79. }
  80.  
  81. switch($main_shop_layout) {
  82. case 'no-sidebar':
  83. woocommerce_content();
  84.  
  85. break;
  86. case 'right-sidebar':
  87.  
  88. echo '<div id="post-area" class="col span_9">';
  89. woocommerce_content();
  90. echo '</div><!--/span_9-->';
  91.  
  92. echo '<div id="sidebar" class="col span_3 col_last">';
  93. get_sidebar();
  94. echo '</div><!--/span_9-->';
  95.  
  96. break;
  97.  
  98. case 'left-sidebar':
  99. echo '<div id="sidebar" class="col span_3">';
  100. get_sidebar();
  101. echo '</div><!--/span_9-->';
  102.  
  103. echo '<div id="post-area" class="col span_9 col_last">';
  104. woocommerce_content();
  105. echo '</div><!--/span_9-->';
  106. break;
  107.  
  108. case 'fullwidth':
  109. echo '<div class="full-width-content">';
  110. woocommerce_content();
  111. echo '</div>';
  112. break;
  113. default:
  114. woocommerce_content();
  115. break;
  116. }
  117.  
  118. }
  119.  
  120. //regular WooCommerce page layout
  121. else {
  122. woocommerce_content();
  123. }
  124.  
  125. ?>
  126.  
  127.  
  128. </div><!--/row-->
  129.  
  130. </div><!--/container-->
  131.  
  132. </div><!--/container-wrap-->
  133.  
  134. <?php get_footer(); ?>
RAW Paste Data