woocommerce layout

Posted in: Newspaper
Post count: 39

Hello i’m struggling to find a way to have 5 columns rather than 4 in the woocommerce shop page. I would need smaller products in 5 columns
Is it possible to do this?
Thanks

Post count: 3343

Hi,
Add this code in function.php file

add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
    function loop_columns() {
        return 5; // 3 products per row
    }
}

like here: http://screencast.com/t/7Y7xSh1LBcxX

Then add this CSS in Theme panel -> Custom CSS

/* responsive monitor */
@media (min-width: 1200px) {
  .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    width: 16.05%;
  }
}
/* responsive portrait tablet */
@media (min-width: 768px) and (max-width: 1018px) {
  .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    width: 16.05%;
  }
}
@media (min-width: 1019px) and (max-width: 1199px) {
  .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    width: 16.05%;
  }
}
Post count: 39

awesome dude you rock

Post count: 39

hi Marius, spotted a bug. If i add featured product shortcodes (5 columns) the layout is broken: pls have a look: http://oi60.tinypic.com/2uzr0nb.jpg

can you tell me how to fix this?

Thank you very much

Post count: 3343

Hi,
Give me your site URL to check if can be solved via CSS.
Thanks!

Post count: 39
Post count: 39

ok now it works not sure how, but they are fine. PLease forget this request.

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.