WordPress.org

Forums

WooCommerce - excelling eCommerce
Displaying 5 products per row, help please! (5 posts)

  1. gasto
    Member
    Posted 2 years ago #

    Hi there

    I'm trying to show 10 products per page, with 5 products per row (2 rows in total per page).

    I've inserted this code in my functions.php

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

    And then added this to my woocommerce.css:
    .products ul, ul.products { width:675px; }

    However, as you may see, they are not displayed correctly: link

    Any help? Thanks a lot

    http://wordpress.org/extend/plugins/woocommerce/

  2. varktech.com
    Member
    Posted 2 years ago #

    .woocommerce ul.products {
        width: 675px;
    }
    
    .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
        float: left;
        margin: 0 3.8% 2.992em 0;
        padding: 0;
        position: relative;
        width: 16%;
    }
  3. gasto
    Member
    Posted 2 years ago #

    Excellent support.
    Thanks a lot

  4. gasto
    Member
    Posted 1 year ago #

    Sorry to open to this again. I've updated woocommerce to the last version, and can't seem to enable pagination properly.
    I want to have 10 products per page, with 5 products per row. I've added these to my functions.php and woocommerce.css respectively, but it's all displayed in one page only.

    // Change number or products per row to 3
    add_filter('loop_shop_columns', 'loop_columns');
    if (!function_exists('loop_columns')) {
    	function loop_columns() {
    		return 5; // 5 products per row
    	}
    }
    .woocommerce ul.products {
        width: 675px;
    }
    
    .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
        float: left;
        margin: 0 3.8% 2.992em 0;
        padding: 0;
        position: relative;
        width: 16%;
    }

    Any clues? Thank you very much.

  5. gasto
    Member
    Posted 1 year ago #

    Anyone got any idea?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic