I'm not sure how to implement a change in my child theme's functions.php. In the woothemes documentation it says that "The functions.php in your child theme should be empty and not include anything from the parent themes functions.php."
I need to use this function to not display a product category, but I'm not sure how to do this in my child theme. Perhaps someone can refer me to instructions?
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() ) {
$q->set( 'tax_query', array(array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'hands-on' ), // Don't display products in the knives category on the shop page
'operator' => 'NOT IN'
)));
}