Centering Shortcode (Woocommerce Product)

Hello there X-theme-inistas,

I come to you in despair… I’ve scoured the forum and have tried to figure out how to center this [products] shortcode but all to no avail.

Could you please help me? It’s about halfway down the page on my homepage: https://gingerguard.com

Thanks for all you guys do - any insights would be super helpful.

Best,

Garett

Hello Garett,

Thanks for writing in! I have inspected your page and I can see that the shortcde has been placed properly. The products should display at the center. At the moment, because there is only one product, it displays in the left side. Once you add two more products which makes it 3 column should properly align the items at the center.

If you only want to display 1 product, you can make use of this code instead:

<div style="max-width: 430px; margin: 0 auto;">[products]</div>

Please let us know if this works out for you.

Hi RueNel,

So that sort of worked but the thumbnail image is super small then. I was hoping to have it be closer to 1400 px max width but when I change it to that it goes back to the left.

Any thoughts?

Hey Garett,

It’s small because you’re displaying a 3 column product display have 1 product.

You can set the columns to 1 (see https://docs.woocommerce.com/document/woocommerce-shortcodes/). @RueNel’s suggestion should work after that.

Thanks.

Ahahh! Right, it defaults to 4 in woocommerce. Hey thanks a ton guys.

You’re welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.