Close

Custom: 4 subcategory in line?

jakubz
one year ago
#14357 Quote
Avatar
  • 144
Hi!
we change a little our page, and want show 4 subcategories in line. We have make that products, but Admin panel support only 2-3 category in line.

Is this hard change to show there 4 subcategories?
Valentin
one year ago
#14359 Quote
Avatar
  • Moderator
  • 137
jakubz wrote:
Hi!
we change a little our page, and want show 4 subcategories in line. We have make that products, but Admin panel support only 2-3 category in line.

Is this hard change to show there 4 subcategories?



Greetings,

to achieve this you need to add the following code to your themes Custom Head Styles section:


@media all and (min-width:1024px) {
.sub-category-grid .item-box {
     width: 23.5% !important;
}

.sub-category-grid .item-box:nth-child(odd) {
     clear: none;
     margin-left: 2%;
}

.sub-category-grid .item-box:nth-child(even) {
     margin-left: 2%;
}

.sub-category-grid.three-per-row .item-box:nth-child(3n+1) {
     clear: none;
     margin-left: 2%;
}

.sub-category-grid .item-box:nth-child(4n+1) {
     clear: left !important;
     margin-left: 0 !important;
}
}


This styling will apply only for the bigger screens, no matter which option you have selected in the admin 2 or 3 per row. And for the smaller screen will apply the normal styling according to the setting you have selected.

This way it is safer because otherwise, the boxes become too small.
Best Regards,

Valentin Kirov
Nop-Templates.com
jakubz
one year ago
#14361 Quote
Avatar
  • 144
Oh! thx! :) that's looks great :)