How to change number of Related Products? (WC 3)
-
I think I have tried all options –?but I just can not change the number of Related Products in WooCommerce 3.0.4.
I hoped the most promising snippet would be the one that can be found in the docs: “Change number of related products output”
function woo_related_products_limit() { global $product; $args['posts_per_page'] = 6; return $args; } add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' ); function jk_related_products_args( $args ) { $args['posts_per_page'] = 4; // 4 related products $args['columns'] = 2; // arranged in 2 columns return $args; }
I put it into the functions.php of my storefront child theme but it just doesn’t have any effect on the number of items displayed. Any pointers / suggestions appreciated. Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to change number of Related Products? (WC 3)’ is closed to new replies.