363

How to Change WooCommerce Product Gallery Thumbnail Columns

Powered by WPCodeBox

Optimize your WooCommerce product galleries by changing the number of thumbnail columns per post. Learn how to easily adjust the layout for a better user experience on your e-commerce site.


<?php

add_filter ( 'woocommerce_product_thumbnails_columns', function() {
    
        // Change the number below the whatever number you want    
        $number_of_product_thumbnails_columns = 4;
    
        return $number_of_product_thumbnails_columns;
    }
);

Other Snippets

WPCodeBox is a WordPress Code Snippets Manager that allows you to share your WordPress Code Snippets across your sites.