My client would like to change the banner on my shop page so it differs from the product page. Is there an easy way to accomplish this? My client would also like to change the number of columns on the shop page to 2 column from the default 4 columns. I realize that this is a default WooCommerce issue but would you have any ideas?
I tried adding this code to the functions.php file but that didn't fix the column issue:
------------------------------------
add_filter('loop_shop_columns', 'custom_loop_columns');
if (!function_exists('custom_loop_columns')) {
function custom_loop_columns() {
return 2;
}
}
------------------------------------
I've also tried:
------------------------------------
add_action ('init', 'change_columns');
function change_columns() {
add_filter( 'loop_shop_columns', 'custom_loop_columns' );
function custom_loop_columns() {
return 2;
}
}
------------------------------------
In addition to this in my CSS:
------------------------------------
ul.products li.product { clear: none; width: 50%; }
------------------------------------
Any ideas?
Thanks Apollo!
Comments
Your PHP code works fine(gives two columns), but CSS is to weak and you will not see good size of products. Do you use sidebar in your shop page ? If yes then try this custom CSS: You can adjust this, remembering that there also have to be space for margin, that is why I am not adding
50%
:-) Banner? Could you show on screen shot and maybe link what you mean by this? Maybe you don't mean real shop page but standard page with woocommerce shortcodes inside?With kind regards.
If you don't want this link to be visible for public then send me it in private message (click on my nick and there you will find option "Send Air a Message").
With kind regards.