skip to Main Content

Move woocommerce category description below products

add_action('woocommerce_archive_description', 'custom_archive_description', 2 );
function custom_archive_description(){
    if( is_product_category() ) :
        remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
        add_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 5 );
    endif;
}

I’m using this code right now for product category descriptions to show the description to the bottom of the page and the products show first. It’s working but when I move to the next page of the same category, the description area disappears, I want to fix the product category descriptions section for all product, and product category pages.

https://ethanza.com/product-category/sports-wear/nfl-uniform/

If you go to this link you can see the problem that I have mentioned.

2

Answers


  1. Please modify your hook as below:

    add_action('woocommerce_after_shop_loop', 'custom_archive_description', 20);
    function custom_archive_description() {
        if (is_product_category()) {
            remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10);
            add_action('woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 5);
        }
    }
    
    Login or Signup to reply.
  2. add_action('woocommerce_archive_description', 'custom_archive_description', 2 );
        function custom_archive_description(){
            if( is_product_category() ) :
                remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
                add_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 5 );
            endif;
        }
    

    Can you try this code?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search