【发布时间】:2009-11-09 19:12:26
【问题描述】:
会发生什么?
我猜在显示之前以某种方式解析帖子或页面,然后分成两种方法?我似乎找不到任何关于底层
<?php wp_link_pages( $args ); ?>
方法确实有效。所有这些处理是在用户加载相关页面之前完成,还是被扫描然后单独存储在数据库中?
【问题讨论】:
标签: wordpress
会发生什么?
我猜在显示之前以某种方式解析帖子或页面,然后分成两种方法?我似乎找不到任何关于底层
<?php wp_link_pages( $args ); ?>
方法确实有效。所有这些处理是在用户加载相关页面之前完成,还是被扫描然后单独存储在数据库中?
【问题讨论】:
标签: wordpress
WordPress 使用 PHP explode 函数将内容拆分为“页面”数组。发生在 setup_postdata 函数中,代码如下:
$pages = explode('<!--nextpage-->', $content);
【讨论】:
来自http://www.digimantra.com/tutorials/wordpress/multipaging-a-single-post-using-wp_link_pages/
Wordpress 有一个名为 wp_link_pages() 的模板标签,它负责帖子的分页。所以你必须把它放在 the_content() 标记之后。与所有其他 wordpress 标签一样,这也有一些参数可以帮助您以非常简单的方式自定义功能。以下是 wordpress 文档定义的参数。
before (string) Text to put before all the links. Defaults to <p>Pages:
after (string) Text to put after all the links. Defaults to </p>.
link_before (string) Text that goes before the text of the link.
link_after (string) Text that goes after the text of the link.
next_or_number (string) Indicates whether page numbers should be used. Valid values are:
* number (Default)
* next (Valid in WordPress 1.5 or after)
nextpagelink (string) Text for link to next page. Defaults to Next page.
previouspagelink (string) Text for link to previous page. Defaults to Previous page.
pagelink (string) Format string for page numbers. % in the string will be replaced with the number, so Page % would generate “Page 1″, “Page 2″, etc. Defaults to %.
more_file (string) Page the links should point to. Defaults to the current page.
【讨论】: