简体   繁体   English

WordPress:分页吗?

[英]WordPress: Paginating a single Page?

I was wondering if someone knows about an option to paginate a regular page? 我想知道是否有人知道分页常规页面的选项? Couldn't find any additional info online. 找不到在线其他信息。

The thing is I'm looking to create a page (default page template) with the possibility to paginate it. 问题是我正在寻找创建一个页面(默认页面模板)并可能对其进行分页。

Am I missing something or is that not possible?! 我错过了什么吗?还是不可能?

Edit : Just a clarification, I'm referring to the page.php template, not any other file such as the index/archive/post etc as those are pretty straight forward. 编辑 :只是为了澄清,我指的是page.php模板,而不是其他任何文件,例如index / archive / post等,因为它们很简单。

Thanks!! 谢谢!! :-) :-)

On most well-coded themes, all you have to do is paste this code: <!––nextpage––> wherever you want the next page to start. 在大多数编码良好的主题上,只需将以下代码粘贴: <!––nextpage––>您想要下一页开始的位置。

If for some reason, pagination is not showing up after you have pasted the next page tags, then you would need to add the following code in your single.php loop. 如果由于某种原因,粘贴了下一页标签后分页没有显示,那么您需要在single.php循环中添加以下代码。

<?php wp_link_pages(); ?>

OK, the short answer is, you guys are right. 好,简短的答案是,你们是对的。

The long answer is that due to a custom post type setting, (has_archive was set to false) the pagination didn't work on the page.php template, but did work on the front page. 长答案是由于自定义帖子类型设置(has_archive设置为false),分页在page.php模板上不起作用,但在首页上起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM