2013-02-26 4 views
1

내 제품 태그와 동일한 태그가있는 게시물을 쿼리하려고합니다. 쿼리 전에 태그를 인쇄 할 수 있습니다 (첫 번째 코드 줄 참조). 작동하지만 쿼리 내에서 모두 잘못되었습니다.Woocommerce에서 쿼리에 사용할 제품 태그 검색

<?php echo $product->get_tags(); ?> 
<?php 
$producttags = get_tags(); 
if ($producttags) { 
foreach($producttags as $tag) { 
    $tag = $tag->slug; break; 
} 
query_posts('tag='.$tag.'&posts_per_page=-1'); 
while (have_posts()) : the_post(); ?> 
<div class="actucontent"> 
    <h3> 
    <?php the_title(); ?> 
    </h3> 
    <?php the_content(); ?> 
</div> 
<?php endwhile; 
wp_reset_query(); 
} 
?> 

어떤 생각? 문제는, 내 질문에 $product->get_tags() 전화하는 법을 모른다.

답변

0

get_tags()는 WP_Post의 멤버이고, $ product는 WC_Product_Simple 유형 인

입니다.
관련 문제