在做模板的时候需要吧某个分类搞成一个单独的样式来显示,该如何调用某个指定的分类呢?
<?php query_posts('cat=20&posts_per_page=4'); while(have_posts()): the_post(); ?> <li><a href="<?php the_permalink(); ?>" target="_blank"><?php the_title();?></a></li> <?php endwhile; wp_reset_query(); ?>
其中:
cat=20 指定要调用的分类目录ID
posts_per_page=4 调用后文章数量
本文由
bigwei08028 创作,除注明转载/出处外,均为本站原创,转载前请务必署名
最后编辑时间为: 2019-05-28 10:59 Tuesday