Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Load a custom template for vendor taxonomy
*/
function load_custom_vendor_template( $located, $template_name ) {
if( is_tax( WC_PRODUCT_VENDORS_TAXONOMY ) && 'archive-product.php' == $template_name ) {
return get_stylesheet_directory() . '/woocommerce/taxonomy-shop_vendor.php';
}
return $located;
}
add_filter( 'wc_get_template', 'load_custom_vendor_template', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment