てかリターンを覚えた
アーカイブで
頭に
1 2 3 4 5 6 7 | <?php //--------------------------------商品アーカイブなら if ( in_category( 'item' ) || //親カテゴリスラッグで分岐 ファンクションコード使用 post_is_in_descendant_category( get_term_by( 'slug' , 'item' , 'category' ))): ?> <?php include (get_stylesheet_directory() . "/d_parts/welcart/welcart-archive.php" ); ?> <? return ; endif ;?> |
というのを入れてリターンすると
アーカイブのときこのテンプレートを読むだけでになる
ただし、ブログTOPにも商品カテゴリをアウトしてやらなければならないので
ファンクションに商品カテIDを追加
ファンクに書いたが
1 2 3 | //<?php query_posts('post_type=post&cat='.$info_cat_out.','.$welcart_cat_out .'&paged='.$paged); ブログトップ //<?php query_posts('post_type=post&posts_per_page=12&cat='.$info_cat_out.','.$welcart_cat_out .'&paged='.$paged); //記事すべて読む |
と入れ替えてやる
また売り切れの分岐
カートに入れるコード
1 2 3 4 5 | <?php if (!usces_have_zaiko() ) : ?> 売り切れ <?php else :?> <?php usces_the_itemSkuButton(__( 'Add to Shopping Cart' , 'usces' ), 0); ?> <?php endif ;?> |