wordpress调用指定分类目录的文章列表

在做模板的时候需要吧某个分类搞成一个单独的样式来显示,该如何调用某个指定的分类呢?

<?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 调用后文章数量

WP优化

wordpress配置个性后台菜单-Menu Editor插件

2020-5-26 13:30:37

WP优化

wordpress不同的分类调用不同的模板

2020-5-26 13:37:35

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索