wordpress按分类ID调用指定分类的文章代码

<?php
    $args=array(
        'cat' => 1,   // 分类ID
        'posts_per_page' => 10, // 显示篇数

    );
    query_posts($args);

    if(have_posts()) : while (have_posts()) : the_post();
?>
    <li>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> 
    </li>
<?php  endwhile; endif; wp_reset_query(); ?>

最后更新日期: 2024:1:5:16:21