get template part fix for loop-shop

This commit is contained in:
Mike Jolley 2012-02-06 09:42:30 +00:00
parent 706d15db2d
commit 871271ffe9
1 changed files with 8 additions and 7 deletions

View File

@ -104,13 +104,14 @@ if (!function_exists('is_ajax')) {
*/
function woocommerce_get_template_part( $slug, $name = '' ) {
global $woocommerce;
if ($name=='shop') :
if (!locate_template(array( 'loop-shop.php', $woocommerce->template_url . 'loop-shop.php' ))) :
load_template( $woocommerce->plugin_path() . '/templates/loop-shop.php',false );
return;
endif;
endif;
get_template_part( $woocommerce->template_url . $slug, $name );
if ($name=='shop' && !locate_template(array( 'loop-shop.php', $woocommerce->template_url . 'loop-shop.php' ))) {
load_template( $woocommerce->plugin_path() . '/templates/loop-shop.php',false );
return;
} elseif ($name=='shop' && locate_template(array( $woocommerce->template_url . 'loop-shop.php' ))) {
get_template_part( $woocommerce->template_url . $slug, $name );
return;
}
get_template_part( $slug, $name );
}
/**