Hi, I simply want to center the products and categories on the shop page. The shop page on desktop is 4 elements per row, but when there is less than 4, I would like them to center themselves. Is it possible? I tried many CSS available online without success.
Thank you for the information. I looked at the provided resource and I understand that I can use PHP to accomplish this. I added the code snippet plugin after reading other GP articles. I understand that I can use the provided example at the bottom of the page and that I need to write a conditional ”if” that says if there is 3 elements or less, use 3 columns, but I don’t know how to write it correctly.
If you are referring to the main shop page, then you can actually use the customizer option.
There isn’t a way to identify how many products there are in the loop without some custom coding which is outside the scope of this forum unfortunately as that’s handled within the WooCommerce plugin itself.
You will basically need to set it to 3 when you only have 3 products, then set it to 4 when you have more products.