We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.
Cookies are small text files that can be used by websites to make a user's experience more efficient.
The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.
This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.
You can at any time change or withdraw your consent from the Cookie Declaration on our website.
Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.
Please state your consent ID and date when you contact us regarding your consent.
Comments
Hi,
Are you using a single product template?
If yes, then in the related products options you can set the number of columns and related products.
Thanks
Is it possible for the pre-built single product layouts? Like Tabs, for instance?
Sorry, but I do not understand.
Can you describe in more detail what would you like to achieve?
Thanks
I mean if I choose one of the BeTheme single product pre-built layouts like this:
Will I be able to adjust the related products columns number with custom CSS?
Yes, it will be possible to achieve that with a custom CSS code for the Tabs style.
If you send a link to your single product, I can help you write it.
Best regards
Here is a link: [Links visible only for registered users]
Please, use the following code:
.woocommerce ul.products li.product, .woocommerce .products.related ul.products li.product{ width: 18%!important; } .woocommerce .products.related ul.products li.product:nth-child(3n+1){ clear: unset!important; } .woocommerce .products.related ul.products li.product:nth-child(5n+1){ clear: both; }Thanks
Great, thank you, it worked!
But it seems adding this code affected the products list on the shop page as well, there are some empty areas appeared: [Links visible only for registered users]
Sorry. Please, use this instead:
.single-product .products.related ul.products li.product{ width: 18%!important; } .single-product .products.related ul.products li.product:nth-child(3n+1){ clear: unset!important; } .single-product .products.related ul.products li.product:nth-child(5n+1){ clear: both; }Thanks
Great, works perfectly! Thank you!
Hello, sorry for bumping this up, but could you also adjust this code for 4 related products? I tried to do it myself, but no luck.
Thanks!
Please, try this one:
.woocommerce ul.products li.product, .woocommerce .products.related ul.products li.product{ width: 22%!important; } .woocommerce .products.related ul.products li.product:nth-child(3n+1){ clear: unset!important; } .woocommerce .products.related ul.products li.product:nth-child(4n+1){ clear: both; }Thanks
Great, thanks!