Home › Forums › WoodMart support forum › Change number of columns for product categories
Change number of columns for product categories
- This topic has 10 replies, 5 voices, and was last updated 4 years, 7 months ago by Artem Temos.
-
AuthorPosts
-
May 8, 2020 at 11:39 am #193429
atpd23ParticipantHi, how could I change number of columns in mobile view for product categories carousel? Should I increase values for “data-mobile” or “owl-items-xs-2”. I need to have fours columns in compare with default two ones.
Attachments:
You must be logged in to view attached files.May 8, 2020 at 12:02 pm #193443
Aizaz Imtiaz AwanKeymasterHello,
I saw the screenshot you attached. Unfortunately, there is no option in theme settings available to change the number of columns for mobile. Because the mobile view inherits from the desktop view.
Sorry you cannot change the number of columns for mobile.
It requires customization and this is beyond our limitations and support policy.
Best Regards.
May 8, 2020 at 12:06 pm #193446
atpd23ParticipantThanks for the fast response. And if I change values for “data-mobile” or “owl-items-xs-2”? Could you please give me know how to change that values by CSS (or script if needed)?
May 9, 2020 at 5:00 am #193580
Aizaz Imtiaz AwanKeymasterHello,
You are Welcome.
Unfortunately, we could not help you with this because it is not possible with Custom CSS and it will require core file customization and this is beyond our limitations and support policy.
Best Regards.
May 9, 2020 at 8:06 am #193608
atpd23ParticipantAnd where could I find that files? I would look at them by myself.
Best Regards.
May 11, 2020 at 6:36 am #193984
Elise NoromitMemberHello,
Please add this code to the functions.php of the child theme:
add_filter('woodmart_categories_shortcode_custom_sizes', function() { return array( 'desktop' => 8, 'tablet_landscape' => 4, 'tablet' => 4, 'mobile' => 4, ); } );
Please note this change would be applied to all the categories carousel. Unfortunately, it is not possible to make it individually.
Best Regards
May 11, 2020 at 11:42 pm #194186
atpd23ParticipantThank you very much Elise for the help. It’s working for the carousel layout of product categories, is there also a way for the default layout?
Best Regards
May 12, 2020 at 6:30 am #194227
Artem TemosKeymasterEdit the file
woodmart\woocommerce\content-product.php
andwoodmart\woocommerce\content-product_cat.php
and change this line$xs_columns = (int) woodmart_get_opt( 'products_columns_mobile' );
to this
$xs_columns = 4;
But this will work for both products and categories.
May 12, 2020 at 1:51 pm #194386
atpd23ParticipantIsn’t there any similar add_filter function as in Elise’s code suggestion but not for carousel layout categories as it is, but only for default layout categories?
Your code is for both products and categories. It’s working, it’s perfect because I can achieve what I really need to, but only for categories. I have to keep products in normal mobile sizes (two columns per row).
Best Regards
May 13, 2020 at 3:49 am #194500
JoieParticipantFollowing this.
I Hope this is configurable in the future for mobile device.Set product 2 column
Set categories 3-4 columnMay 13, 2020 at 6:12 am #194520
Artem TemosKeymasterTry to edit this file only
woodmart\woocommerce\content-product_cat.php
. And you can copy it to the child theme to keep your changes after update. -
AuthorPosts
- You must be logged in to create new topics. Login / Register