Archived topic
Woocommerce How to have different Columns Layout in Shop and Categories
4 replies · Started by Mikel Mandon on October 24, 2017
Hi GP Team
A Woocommerce related question: How to get a 4 columns Layout in the shop and 1 column layout in Categories, currently with the customizer both are the same. Any hints?
I added that code on the child-theme functions
// Change number or products per row to 4
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
return 4; // 4 products per row
}
}
But it didn't work...
thanks
Mikel
Hi there,
Maybe I'm misunderstanding something but those should have different options?
This should apply to blog/archive/category: https://docs.generatepress.com/article/using-columns-in-the-blog/
And this applies to shop page: https://docs.generatepress.com/article/woocommerce-overview/#shop
Let me know :)
Hi Leo
Sorry by Categories I did not mean Post Categories but Product Categories. I want to have a 4 column layout at the SHOP to display the categories, and a 1 column layout at the Product Category page to display the available products at those categories, I hope that make sense.
Thanks,
Mikel
Should be able to use this snippet here: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type
With is_product_category() like we tried in your other post.
Let me know :)
Also the following plugin can help:
https://wordpress.org/plugins/woo-visual-hook-guide/