WordPress:Template Tags/link pages

来自站长百科
跳转至: 导航、​ 搜索

This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists.


描述[ ]

为标了页数的文章显示网页链接(例如,包括the <!--nextpage--> Quicktag一次或者几次)。这与wp_link_pages()的运行方式基本相同,标签必须在The_Loop内部。

取代[ ]

wp_link_pages().

用法[ ]

%%% <?php link_pages('before', 'after', 'next_or_number',

      'nextpagelink', 'previouspagelink', 'pagelink', 
      'more_file'); ?> %%%

例子[ ]

默认用法[ ]

默认显示网页链接,网页链接的前后都有行分隔符,使用上一页下一页,并将这些网页标号为第 1页,第 2页等等。

<?php link_pages(); ?>

段落标签中的网页链接[ ]

显示由段落标签包围的网页链接。

<?php link_pages('<p>', '</p>', 'number', '', '', 'page %'); ?>

参数[ ]

before
(string) 所有的链接之前放置的文本。默认为'<br />'
after
(string) 所有的链接之后放置的文本。默认为'<br />'
next_or_number
(string) 暗示是否会用到网页页码。有效的参数值是:
  • 'number' (Default)
  • 'next'(在 WordPress 1.5 或者以后的版本中有效)
nextpagelink
(string) 链接到下一个网页的文本 。默认为'下一个网页'。(在WordPress1.5及以后的版本中有效)


previouspagelink
(string)链接到上一个网页的文本。默认为上一个网页。(在WordPress1.5及以后的版本中有效)
pagelink
(string) 网页页码的格式字符串。字符串中的'%'会被数字取代,因此'Page %'会产生"第1页", "第2页",等等。默认为'%'
more_file
(string)链接指向的而网页。默认为当前网页。

相关的[ ]

要使用字符串来传递参数,请看看wp_link_pages()


模板:标签 链接标签

模板:PHP函数标签 页底文字