Browse Source

Radcliffe 2: Fixes Jetpack Infinite Scroll WC issues.

Jeffrey Pearce 7 years ago
parent
commit
1e449bcc92
2 changed files with 14 additions and 3 deletions
  1. 12 1
      radcliffe-2/inc/jetpack.php
  2. 2 2
      radcliffe-2/woocommerce.css

+ 12 - 1
radcliffe-2/inc/jetpack.php

@@ -19,7 +19,7 @@ function radcliffe_2_jetpack_setup() {
 		'container'      => 'main',
 		'container'      => 'main',
 		'render'         => 'radcliffe_2_infinite_scroll_render',
 		'render'         => 'radcliffe_2_infinite_scroll_render',
 		'footer'         => 'page',
 		'footer'         => 'page',
-		'wrapper'        => false,
+		'wrapper'         => false,
 		'footer_widgets' => array( 'sidebar-1', 'sidebar-2', 'sidebar-3' ),
 		'footer_widgets' => array( 'sidebar-1', 'sidebar-2', 'sidebar-3' ),
 	) );
 	) );
 
 
@@ -56,14 +56,25 @@ add_action( 'after_setup_theme', 'radcliffe_2_jetpack_setup' );
  * Custom render function for Infinite Scroll.
  * Custom render function for Infinite Scroll.
  */
  */
 function radcliffe_2_infinite_scroll_render() {
 function radcliffe_2_infinite_scroll_render() {
+	if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) ) {
+		radcliffe_2_woocommerce_product_columns_wrapper();
+		woocommerce_product_loop_start();
+	}
 	while ( have_posts() ) {
 	while ( have_posts() ) {
 		the_post();
 		the_post();
 		if ( is_search() ) :
 		if ( is_search() ) :
 			get_template_part( 'template-parts/content', 'search' );
 			get_template_part( 'template-parts/content', 'search' );
+		elseif ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) ) :
+			wc_get_template_part( 'content', 'product' );
 		else :
 		else :
 			get_template_part( 'template-parts/content', get_post_format() );
 			get_template_part( 'template-parts/content', get_post_format() );
 		endif;
 		endif;
 	}
 	}
+
+	if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) ) {
+		woocommerce_product_loop_end();
+		radcliffe_2_woocommerce_product_columns_wrapper_close();
+	}
 }
 }
 
 
 /**
 /**

+ 2 - 2
radcliffe-2/woocommerce.css

@@ -360,8 +360,8 @@ ul.products li.product .button {
 	text-align: center;
 	text-align: center;
 }
 }
 
 
-.woocommerce-page #infinite-handle {
-	display: none;
+.infinite-scroll .woocommerce-pagination {
+    display: none;
 }
 }
 
 
 @media screen and (min-width: 768px) {
 @media screen and (min-width: 768px) {