좋아 나는이 루프 코드가 있습니다 : 현재 루프 카테고리 아이들이 다음 정말 H2의 같은 아이들 이름을 모두 (또는 무엇이든을 표시 할 경우 내가해야 할 일은WordPress의 경우
<?php
//get all categories then display all posts in each term
$taxonomy = 'category';
$param_type = 'category__in';
$term_args=array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 0,
'hierarchical' => 0
);
$terms = get_terms($taxonomy,$term_args);
if ($terms) {
foreach($terms as $term) {
$args=array(
"$param_type" => array($term->term_id),
'post_type' => 'products',
'post_status' => 'publish'
);
$my_query = null;
$my_query = new WP_Query($args);
if(/*$my_query->have_posts()*/ 1==1) { ?>
<div id="<?php echo str_replace(" ","",$term->name); ?>" class="category section">
<h3 class="categoryTitle"><?php echo $term->name;?></h3>
<?php
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="product">
<h3 class="productTitle"><?php the_title(); ?></h3>
<div class="description"><?php the_content(); ?></div>
</div>
<div class="clearfix"></div>
<?php
endwhile;
?>
</div>
<?php
}
}
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
이며,)? 내가 어떻게 할 수 있니?
건배 Dave는 광범위한 노력을 기울이고 있습니다. – benhowdle89