谁能帮我编辑这段代码?我有 2 个类别,点击后我会显示该类别的所有帖子。现在我在两个类别中都看到了类别 id 8 的内容。我的代码来自 category.php
<?php
$args = array( 'posts_per_page' => 5, 'category' => 8);
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<li class="ikonakategoriiwpisu">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php the_post_thumbnail( 'thumbnail' ); ?> </a><?php the_excerpt(); ?>
</li>
<?php endforeach;
wp_reset_postdata();?>