• Resolved samina04

    (@samina04)


    Hello,
    I had to replace the product loop in archive-product.php with the wc shortcode, since the product filters i am using are working only with the shortcode!

    This is how my file looks like (its in my child theme):

    <?php
    defined( 'ABSPATH' ) || exit;
    get_header( 'shop' );
    do_action( 'woocommerce_before_main_content' );
    ?>
    <header class="woocommerce-products-header">
    	<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
    		<h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1>
    	<?php endif; ?>
    <?php
    do_action( 'woocommerce_archive_description' );
    	?>
    </header>
    <?php
    do_action( 'woocommerce_before_shop_loop' );
    echo do_shortcode('[products limit="20" columns="4"]'); 
    do_action( 'woocommerce_after_shop_loop' );
    do_action( 'woocommerce_after_main_content' );
    do_action( 'woocommerce_sidebar' );
    get_footer( 'shop' );
    

    The issue now is that it show the same products in the product archives, no matter what category i open. I have searched through the forums but cant find how to show the products from the current category.

    Thank you ??

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘shortcode not displaying curent categorys’ is closed to new replies.