简体   繁体   中英

Wordpress/WooCommerce Products per row

I've previously been trying to set products per row the ordinary way by simply setting it the number of products per row in the woocommerce shortcode. This however did not work. So I was given the code to enter in fuctions.php Code below:

    // 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
    }
}

This did solve the issue as seen on this here . However if the number of products (it seems) exceeds 3 when using the products category shortcode I get a different result entirely. Seen here , if you scroll down a bit you can see that on the first row I get 3 products, but then 1, then 2 and then 1 again?

I find it all very strange and I would appriciate any help I can get! Thanks a lot in advance!

在第一页(工作正常的页面)上,“ <li>”元素的类为“ col-md-4 col-sm-6”,但是在错误的页面上,您的类为“ col-md-3 col-sm” -4" 。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM