Unable to show 4 products in row in subcategory/shop page woocommerce

I’m unable to show 4 products in a row, I just put the filter in my themes/functions.php.

Code is below:

Read More
function loop_columns(){
 return 4;
}
add_filter('loop_shop_columns', 'loop_columns',999);

When I return 3, all working is fine, but when I put 4 here, it shows the grid like this:


Product |
______________________________________
Product | Product | Product | Product
______________________________________
Product | Product | Product | Product
______________________________________
Product | Product | Product | Product

Note: Why does product display on top? Please help me. Live link of this issue is
http://csjs.com/product-category/bhai-guriqbal-singh-ji-books/

More detail : 4 products in a row, But after adding filter for 4 columns in functions.php, This problem occur. If somebody go to direct my shop page everything is fine, but if somebody open a category wise products its not showing well, because i also show sub-categories of the parent on shop page.

Note: If i reduce the width upper 3 columns, This single product in a row shift on above row. But My requirement is, One row show only sub categories and grid show the products.

All the grid items are a part of same ul element, its class is products.

Related posts