【问题标题】:How to display child posts of a given post with pagination?如何使用分页显示给定帖子的子帖子?
【发布时间】:2010-05-28 01:05:02
【问题描述】:

我是 wordpress 的新手。谁能帮我在给定的父帖子下显示帖子列表。我需要管理这些子帖子的分页。我用过这段代码。

 $all_pages = get_pages('child_of='.$post->ID.'&sort_column=post_title');
foreach($all_pages as $pages)
           {
                     // here goes display of the post info
                   }

提前致谢。

【问题讨论】:

    标签: wordpress pagination


    【解决方案1】:

    查看函数paginate_links()。使用它来创建分页 HTML,以及一些 PHP 逻辑来创建 limitoffset 变量的值,您可以将其传递给 get_pages()

    【讨论】:

      猜你喜欢
      • 2020-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多