Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active January 7, 2022 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/81c2f0a148e5e39c9d275d81d0a66f8f to your computer and use it in GitHub Desktop.
Save webtoffee-git/81c2f0a148e5e39c9d275d81d0a66f8f to your computer and use it in GitHub Desktop.
Modify number of columns - Related Products for WooCommerce (https://wordpress.org/plugins/wt-woocommerce-related-products/)
<?php //do not copy this line
/**
* Modify no.of columns - related products
* Note: It does not work for all themes because of the way they're coded.
*/
function wt_crp_related_products_args( $args ) {
$args['columns'] = 4; // arranged in 4 columns
return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'wt_crp_related_products_args', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment