Your fancy clothes store is ready, you have the best clothes of the city, and hundreds of photos of them, ready to be uploaded in your store.
They will look great online, people will go crazy to buy them and you will be rich!
But how to use all those awesome photos you made? They just don’t fit, the product gallery in the single product page shows only three photos per row and the page looks too long.
What if I say you that you can change the number of photos per row with one line of code?
Disclaimer: If this snippet does not work, most probably your theme is overriding the template product-gallery.php
and it removed the filter within it.
Open the file functions.php located in wp-content/themes/your-theme-name/ and add this code at the end of it:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_product_thumbnails_columns', create_function( '', 'return 4;' ) ); |
From now on, the single product gallery will show four pictures per row. You can further increase that by changing the value in the snippet.
Be careful though, you will probably need to change your CSS too to make them look properly or they will probably stretch or be too small.
Leave a Reply