Columns styling

This commit is contained in:
Mike Jolley 2017-11-10 17:50:56 +00:00
parent 3bf47d7d97
commit 1d93d8f577
6 changed files with 41 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -145,6 +145,35 @@
} }
} }
ul.products {
&.columns-1 {
li.product {
width: 100%;
margin-right: 0;
}
}
&.columns-2 {
li.product {
width: 48%;
}
}
&.columns-3 {
li.product {
width: 30.75%;
}
}
&.columns-5 {
li.product {
width: 16.95%;
}
}
&.columns-6 {
li.product {
width: 13.5%;
}
}
}
&.columns-1 { &.columns-1 {
ul.products { ul.products {
li.product { li.product {

View File

@ -13,7 +13,11 @@
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 2.0.0 * @version 3.3.0
*/ */
global $woocommerce_loop;
$columns = ! empty( $woocommerce_loop['columns'] ) ? $woocommerce_loop['columns'] : wc_get_default_products_per_row();
?> ?>
<ul class="products"> <ul class="products columns-<?php echo esc_attr( $columns ); ?>">