一段以分类形式显示WordPress文章列表代码,修改其中的数字10可以设定显示的篇数,可用于在单页面上显示全部分类文章。
- <?php
- = get_categories();
- ( ) {
- query_posts( \’showposts=10&cat=\’ . ->cat_ID );
- ?>
- <h3><?php ->cat_name; ?></h3>
- <ul =>
- <?php ( have_posts() ) { the_post(); ?>
- <li><a href=><?php the_title(); ?></a></li>
- <?php } wp_reset_query(); ?>
- </ul>
- <?php } ?>
暂无评论内容