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!

Read more here: WordPress/WooCommerce Products per row

Leave a Reply

Your email address will not be published. Required fields are marked *