Products are too close in wooCommerce with 2013 Wo

2019-08-07 09:45发布

I have installed wooCommerce plugin in WordPress, then activated the "Twenty Thirteen" theme and have added 4 products.

Does anybody please know how to fix the problem, that the products are show too close and their "Add to basket" labels overlap (at least in Russian language, here fullscreen)?

website screenshot

I have tried different widget configurations, like removing the basket from the right side - this doesn't help.

If needed, I'm comfortable with editing JS, CSS and PHP files - but don't know WordPress well.

3条回答
小情绪 Triste *
2楼-- · 2019-08-07 09:50

There are many ways that you could fix this layout issue, but here's a quick fix for you.

Add this to your css:

.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    min-width: 220px;
}

This isn't a perfect solution, and a look at your actual image sizes and desired output would help to make this work better, but this will fix your issue.

Another possible solution is to use the shortcode in the template file for your shop and limit the output to 3 columns.

<?php echo do_shortcode('[products ids="1, 2, 3, 4, 5" columns="3"]');?>

As mentioned in another answer, to directly change the number of columns without creating a custom template for the shop page:

add_filter( 'loop_shop_columns', function() { return 3; } );

Add this to your functions.php file within your theme.

查看更多
爷的心禁止访问
3楼-- · 2019-08-07 09:53

To change the number of products per row use loop_shop_columns filter.

/* functions.php */

add_filter( 'loop_shop_columns', function() { return 3; } );

But that still will not solve the problem, you will probably have to override WooCommerce styles for button and product list elements ( note that first and last elements in the row have specific CSS classes 'first' and 'last' ).

查看更多
不美不萌又怎样
4楼-- · 2019-08-07 10:05

This is what I did to move the products apart. Add this to your css:

.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
padding: 15px;

}

查看更多
登录 后发表回答