开发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代表显示几条记录。
本文介绍了一段用于WordPress网站开发的PHP代码,通过调整分类ID和显示记录数,可以灵活展示特定分类的文章列表,适用于定制化的WordPress站点建设。
50





