2012-03-28 9 views
0

商品詳細ページで商品のカテゴリループを作成したいと思います。 (製品の下)。製品は、製品アイテムと同じカテゴリのものです。Wordpress WP-E-Commerceプラグイン。カテゴリループを作成する必要があります

普通のカテゴリのargsは、標準のWordpressのargsでは動作しないようです。 wpsc_print_category_image()wpsc_print_category_name();などのWPECのカスタムテンプレートタグは、カスタム設定では機能しないようです。ここで

は私が

<?php 
$args = array('post_type' => 'wpsc-product','posts_per_page' => 999, 'orderby'=>'title','order'=>'ASC','category_id'=>'5'); 
$loop = new WP_Query($args); 

while ($loop->have_posts()) : $loop->the_post(); 
    //the_title(); 
    echo '<div class="isotope-item box default_product_display product_view_'; 
    echo wpsc_the_product_id(); 
    echo '">'; 
    echo '<img src="'; 
    echo wpsc_the_product_image(); 
    echo '"/>'; 
    ?> 
    <div class="prod-info-container"> 

      <div class="prod-info"> 

      <h3 class="prodtitle entry-title"> 
          <?php if(get_option('hide_name_link') == 1) : ?> 
           <?php echo wpsc_the_product_title(); ?> 
          <?php else: ?> 
           <?php echo wpsc_the_product_title(); ?> 
          <?php endif; ?> 
         </h3>  

          <p> 


          <?php echo the_excerpt(); ?> 
         </p><!--close wpsc_description--> 
         <a class="view-detail" href="<?php the_permalink();?>">view</a> 
      </div> 
      </div>   
    <?php 
    echo '</div>'; 
endwhile; 
?> 

を行うにしようとしています何の例です。これは私のすべての製品を提供しますが、私は1つのカテゴリだけに制限したいです。

ありがとうございます。

答えて

1

これは私がやってしまったものです:

$category = get_the_category(); 
$wpsc_product_category = get_the_product_category(wpsc_the_product_id()); 
$curr_cat = $wpsc_product_category[0]->slug; 
関連する問題