Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created June 29, 2017 08:34
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 SiR-DanieL/44e1a207ebe3b5e78c4072bc38a5c69a to your computer and use it in GitHub Desktop.
Save SiR-DanieL/44e1a207ebe3b5e78c4072bc38a5c69a to your computer and use it in GitHub Desktop.
<?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