change number of product per row in woocommerce

前端 未结 3 1006
执笔经年
执笔经年 2020-12-17 00:55

I am using woocommerce with a themefores template. By default woocommerce show 4 product per row, but I want to show 5.

I am using a child template so I duplicate wo

3条回答
  •  死守一世寂寞
    2020-12-17 01:56

    Try this,

    In your function.php check this function.

    // Change number or products per row to 3
    add_filter('loop_shop_columns', 'loop_columns');
    if (!function_exists('loop_columns')) {
    function loop_columns() {
    return 3; // 3 products per row
    }
    }
    

    Then your child theme add this,

    // Override theme default specification for product # per row
    function loop_columns() {
    return 5; // 5 products per row
    }
    add_filter('loop_shop_columns', 'loop_columns', 999);
    

    for more details check this

    Hope it helps..

提交回复
热议问题