Skip to content

Instantly share code, notes, and snippets.

@ioniacob
Forked from growdev/gist:4074021
Created October 22, 2016 15:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ioniacob/9d767cff4553767948d15cfda9da6189 to your computer and use it in GitHub Desktop.
WooCommerce - Remove the "Related Products" section from a template by removing the related posts query arguments.
<?php
/*
* wc_remove_related_products
*
* Clear the query arguments for related products so none show.
* Add this code to your theme functions.php file.
*/
function wc_remove_related_products( $args ) {
return array();
}
add_filter('woocommerce_related_products_args','wc_remove_related_products', 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment