Changing the number of columns in archive pages in woocommerce

£可爱£侵袭症+ 提交于 2019-12-06 09:17:29
LoicTheAztec

This snippet code will change the number of products per page on all archives pages:

add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
    function loop_columns() {
        return 3;
    }
}

This code goes on function.php file of your active child theme or theme

Advice: Sometimes, is necessary to change some css rules, to get the correct display per row.

If you want to target some specific archive pages you can use WooCommerce conditionals tags in an if/else statement as in this thread


References:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!