Skip to content

Instantly share code, notes, and snippets.

@furahaclothing
Created March 2, 2013 08:17
Show Gist options
  • Save furahaclothing/5070150 to your computer and use it in GitHub Desktop.
Save furahaclothing/5070150 to your computer and use it in GitHub Desktop.
welcartでカテゴリー別で商品詳細ページを変える。(ex:カテゴリー3はsingle1.php。その他のカテゴリーはsingle4.phpを使う)
add_action('usces_action_template_redirect', 'my_action_template_redirect', 8);
function my_action_template_redirect(){
global $usces, $post, $usces_entries, $usces_carts, $usces_members, $usces_item, $usces_gp, $member_regmode;
if( is_single() && 'item' == $post->post_mine_type ) {
if (in_category('3')){
if(file_exists(get_stylesheet_directory() './single1.php')){
include(get_stylesheet_directory() .'/single1.php');
exist;
}
}
else{
if(file_exists(get_stylesheet_directory() .'/single4.php')){
include(get_stylesheet_directory() .'/single4.php');
}
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment