wp_query get the 2nd post 时间:2019-12-01 作者:aye cee 如何才能在此查询中仅获取第二个产品?$loop = new WP_Query( [ \'post_type\' => \'product\', \'posts_per_page\' => 1, \'meta_key\' => \'total_sales\', \'orderby\' => \'meta_value_num\', ), ), ] ); 1 个回复 最合适的回答,由SO网友:aye cee 整理而成 我想你可以用\'offset\' => 1, 跳过一篇文章,获得第二篇。将数字更改为要跳过的帖子数量。即,将其设置为2以获得第3个。$loop = new WP_Query( [ \'post_type\' => \'product\', \'posts_per_page\' => 1, \'offset\' => 1, \'meta_key\' => \'total_sales\', \'orderby\' => \'meta_value_num\', ] ); 文章导航