$args = array(
\'post_type\' => \'post\', //Specifying the type of posts
\'cat\'=> 1, //Selecting post category by ID to show
\'posts_per_page\' => 4, //No. of posts to show
\'paged\' => $paged //For pagination
);
//You dont need to use query_posts( $args ); since you are using wp_query
$query = new WP_Query( $args );
像这样使用while循环
while ( $query->have_posts() ) : $query->the_post();
而不是这个
while ( have_posts() ) : the_post();
如果您不知道在哪里可以找到帖子ID,请阅读
this article 了解post ID