Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何跳过WordPress中的第一篇帖子?_Php_Wordpress - Fatal编程技术网

Php 如何跳过WordPress中的第一篇帖子?

Php 如何跳过WordPress中的第一篇帖子?,php,wordpress,Php,Wordpress,如何跳过WordPress中的第一篇帖子 <?php $recentPosts = new WP_Query(); $recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri'))); ?> <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> 使用以下参数: <?

如何跳过WordPress中的第一篇帖子

<?php
$recentPosts = new WP_Query();
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

使用以下参数:

<?php
$recentPosts = new WP_Query( 'offset=1' ) );
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

这个答案是错误的。设置偏移量将中断分页。