Created
March 2, 2013 08:17
-
-
Save furahaclothing/5070150 to your computer and use it in GitHub Desktop.
welcartでカテゴリー別で商品詳細ページを変える。(ex:カテゴリー3はsingle1.php。その他のカテゴリーはsingle4.phpを使う)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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