- mylawer2019-04-10中级会员15297
用了以下方式调用,输出的是文章所有分类的文章。怎么调用指定分类的文章?
另外如果这个子分类a包括子分类b、c的话,子分类a会把bc的文章都调用出来,就重复了。
谢谢大佬解答。- $cat,
- 'parent' => $cat,
- 'hide_empty' => 0
- ));
- $c = get_category($cat);
- if(empty($cats)){
- ?>
- - - - " href="">
- - ">more >>
- | 标签:
- - - - 暂无文章
- - - - - - - $the_cat->cat_ID,
- 'numberposts' => 10,
- ));
- if(!empty($posts)){
- echo '
- - name.'" href="'.get_category_link($the_cat).'">'.$the_cat->name.'
- ';
- foreach($posts as $post){
- echo '- '.mysql2date('Y-m-d', $post->post_date).'
- post_title.'" href="'.get_permalink($post->ID).'">'.$post->post_title.'';
- }
- echo '
- ';
- }
- }
- }
- ?>
- 复制代码