Home Forums WoodMart support forum Shop page products columns separately from category page

Shop page products columns separately from category page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #62086

    Nik
    Participant

    Hi, guys!

    I need to show 5 products columns per row on shop page and 3 on category pages

    earlier I’ve used this code

    
    function nicky_product_columns_frontend() {
    
    	if ( is_shop() ) :
    		return 5;
    	endif;
    
    	return 3;
    }
    add_filter('loop_shop_columns', 'nicky_product_columns_frontend', 999);
    

    it worked
    but since last theme update it doesn’t work any more

    Thanks!

    #62097

    Hello,

    Please provide your site admin access and FTP

    Best Regards

    #62122

    Nik
    Participant

    in private content

    #62134

    Hello,

    Please try this code:

    function nicky_product_columns_frontend() {
    	if ( is_shop() ) {
            woodmart_set_loop_prop( 'products_columns', 6 );
            return;
        }
        woodmart_set_loop_prop( 'products_columns', 3 );
        return;
    }
    add_action('woocommerce_before_shop_loop', 'nicky_product_columns_frontend', 999);

    Best Regards

    #62140

    Nik
    Participant

    It works, thank you very much, Elise

    Have a nice day 🙂

    #62143

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Shop page products columns separately from category page’ is closed to new replies.