Last active
February 14, 2021 09:55
-
-
Save jimjasson/c4ccf02148b03fc64185489e9edafff7 to your computer and use it in GitHub Desktop.
Use this snippet to change the bundled items column count when using the 'Grid' Layout option
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
<?php | |
/** | |
* Plugin Name: WooCommerce Product Bundles - Bundled Items Grid Layout column count | |
* Plugin URI: http://woocommerce.com/products/product-bundles/ | |
* Description: Use this snippet to change the bundled items column count when using the 'Grid' Layout option. | |
* Version: 1.0 | |
* Author: SomewhereWarm | |
* Author URI: http://somewherewarm.gr/ | |
* Developer: Jason Kytros | |
* | |
* | |
* Copyright: © 2018 Jason Kytros (jask@somewherewarm.gr). | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
add_filter( 'woocommerce_bundled_items_grid_layout_columns', 'wc_pb_grid_layout_change_number_of_columns', 10, 2 ); | |
function wc_pb_grid_layout_change_number_of_columns( $columns, $bundle ) { | |
return 4; | |
} |
This works for desktop. But not looks good on mobile. It would be great if it is possible to extend to different screen sizes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Excellent stuff, thanks.