Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
Pagination 列出子页面的WP分页_Pagination_Wordpress - Fatal编程技术网

Pagination 列出子页面的WP分页

Pagination 列出子页面的WP分页,pagination,wordpress,Pagination,Wordpress,我正在开发一个wordpress,并使用它制作了一个短标记,在父页面上列出子页面 但是,我需要在这个页面中添加一个分页,以便在此页面上仅列出我有短标记的9个最近的子页面 知道怎么做吗?或者用一些支持分页以列出子页面的东西来代替它。您需要调整$args以使用每页发布设置限制 $args = array( 'post_parent' => $post->ID, 'post_type' => 'page', 'posts_per_page' =

我正在开发一个wordpress,并使用它制作了一个短标记,在父页面上列出子页面

但是,我需要在这个页面中添加一个分页,以便在此页面上仅列出我有短标记的9个最近的子页面


知道怎么做吗?或者用一些支持分页以列出子页面的东西来代替它。

您需要调整
$args
以使用
每页发布
设置限制

    $args = array(  
    'post_parent' => $post->ID,  
    'post_type' => 'page',
    'posts_per_page' => 9
); 
要使分页工作正常,我建议。安装后,请在希望其显示的位置调用此选项:

<?php if(function_exists('wp_simple_pagination')) {
    wp_simple_pagination();
} ?> 


分页不适用于Wordpress中的页面。页面不是分页的意思。

此插件允许对帖子和评论进行分页,但不允许对页面进行分页。。。你确定它会工作吗?分页页面?好吧,那需要一些完全不同的东西。就个人而言,页面并不意味着“分页”,它们与帖子是完全不同的实体。你为什么要翻页,它们应该在菜单中处理。嗯。。。我知道,但出于某种原因我需要它:(