Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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 跳过wp_get_archives()中的最新wordpress帖子_Php_Wordpress_List - Fatal编程技术网

Php 跳过wp_get_archives()中的最新wordpress帖子

Php 跳过wp_get_archives()中的最新wordpress帖子,php,wordpress,list,Php,Wordpress,List,在我的侧边栏中,我列出了最新的wordpress帖子,如下所示: wp_get_归档文件('type=postbypost&limit=10') 这也将显示当前在我的博客首页可见的帖子的链接。如果这些帖子在主页上可见,那么将它们包括在列表中是没有意义的 在法典中,我找不到排除头版文章的选项。 如何执行此操作?使用“偏移”参数,如下所示: wp_get_archives('type=postbypost&limit=10&offset=0'); $recent_posts = n

在我的侧边栏中,我列出了最新的wordpress帖子,如下所示: wp_get_归档文件('type=postbypost&limit=10')

这也将显示当前在我的博客首页可见的帖子的链接。如果这些帖子在主页上可见,那么将它们包括在列表中是没有意义的

在法典中,我找不到排除头版文章的选项。
如何执行此操作?

使用“偏移”参数,如下所示:

wp_get_archives('type=postbypost&limit=10&offset=0');
$recent_posts = new WP_Query('showposts=3&offset=3&');

当然,您必须将0替换为所需数量的要跳过的帖子。

我认为wp\u get\u归档文件没有偏移功能。


您将不得不使用get_帖子。你可以使用上面提到的,或者设置它,使它显示10

您也可以使用WP\u查询,如下所示:

wp_get_archives('type=postbypost&limit=10&offset=0');
$recent_posts = new WP_Query('showposts=3&offset=3&');

我尝试了这个,但是偏移参数不起作用。它也不是一个记录在案的参数: