Radcliffe 2: Fixes Jetpack Infinite Scroll WC issues.

This commit is contained in:
Jeffrey Pearce 2018-03-27 15:37:11 +02:00
parent f202712466
commit 1e449bcc92
2 changed files with 14 additions and 3 deletions

View file

@ -19,7 +19,7 @@ function radcliffe_2_jetpack_setup() {
'container' => 'main',
'render' => 'radcliffe_2_infinite_scroll_render',
'footer' => 'page',
'wrapper' => false,
'wrapper' => false,
'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.
*/
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() ) {
the_post();
if ( is_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 :
get_template_part( 'template-parts/content', get_post_format() );
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();
}
}
/**

View file

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