Skip to content

Instantly share code, notes, and snippets.

@palimadra
Created October 16, 2014 07:33
Show Gist options
  • Save palimadra/914f759ae967e856d9d2 to your computer and use it in GitHub Desktop.
Save palimadra/914f759ae967e856d9d2 to your computer and use it in GitHub Desktop.
functions.php for wordpress
<?php
/**
* Load a custom template for vendor taxonomy
*/
function load_custom_vendor_template( $located ) {
global $wc_product_vendors;
if( is_tax( $wc_product_vendors->token ) ) {
return get_template_directory() . '/woocommerce/taxonomy-shop_vendor.php'; // Change here the file name if needed
}
return $located;
}
add_filter( 'wc_get_template', 'load_custom_vendor_template' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment