网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > WordPress
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 112.87.85.4
Old 2015-06-14, 06:32 AM
Jayla Jayla is offline
初级会员
 
Join Date: 2009-03-09
Posts: 1
Jayla 现在声名狼藉
Default wordpress 实现文章页/page页分页

wp_link_pages($args) 该模板标签为分页文章(如文章中包含一个或一个以上<!--nextpage--> 快速标签)显示分页链接。与link_pages()运行方式几乎一致,区别在于,该标签的参数以查询字符串形式传递

默认用法

<?php $args = array(
'before' => '<p>' . __('Pages:'),
'after' => '</p>',
'link_before' => ,
'link_after' => ,
'next_or_number' => 'number',
'nextpagelink' => __('Next page'),
'previouspagelink' => __('Previous page'),
'pagelink' => '%',
'more_file' => ,
'echo' => 1 ); ?>


参数
before

(字符串)显示在所有链接前的文本。默认值为<p>Pages:。

after

(字符串)显示在所有链接后的文本。默认值为</p>。.

link_before

(字符串)链接文本前的文字。默认值为(blank)(空)。在WP 2.7以及更高版本中,该参数为必要参数。

link_after

(字符串)链接文本后的文字。默认值为(blank)(空)。在WP 2.7以及更高版本中,该参数为必要参数。

next_or_number

(字符串)是否使用页数。有效值包括:

number(默认)
next(WP 1.5及之后版本中有效)
nextpagelink

(字符串)下一页链接的链接文本。默认值为Next page(下一页)。(WP 1.5及之后版本中有效)

previoustpagelink

(字符串)上一页链接的链接文本。默认值为Previous page(上一页)。(WP 1.5及之后版本中有效)

pagelink

(字符串)页数的格式化字符串。字符串中的%会被替换为数字,因此Page % 会转换成"Page 1"、"Page 2"等。默认为%。

more_file

(字符串)链接所指向的网页。默认为当前页面。

echo

(布尔型)响应或返回结果。默认值为true。有效值包括: 1 (True)—— 默认值 0(False)

默认用法:

<?php wp_link_pages(); ?> 实现数字+上下分页:(如图)


<?php wp_link_pages('before=<div id="page-links">&next_or_number=number'); wp_link_pages('before=&after=</div>&next_or_number=next&previouspagelink=上一页&nextpagelink=下一页'); ?> 实现上一页+数字+下一页:(如图 )


<?php wp_link_pages('before=<div id="page-links">&next_or_number=next&previouspagelink=上一页&nextpagelink=&nbsp;'); wp_link_pages('before=&after=&next_or_number=number&pagelink=%'); wp_link_pages('before=&after=</div>&pagelink=%&next_or_number=next&nextpagelink=下一页&previouspagelink=&nbsp;'); ?> 注:这种上一页+数字+下一页的方式实现不是很完美,他有多余的两个空格链接。
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Steps to Change Your Table Prefix in WordPress Abby WordPress 0 2014-04-14 03:40 PM
Install WordPress on IIS topvip Blog(博客)/Wiki(维客)/RSS/Cms 1 2010-01-25 08:31 PM
让wordpress首页显示特殊页面(flash首页等) yahoo Blog(博客)/Wiki(维客)/RSS/Cms 0 2009-02-25 06:58 AM
wordpress 搜索引擎优化的二十条实用技巧 car 搜索引擎优化 0 2008-03-11 08:33 AM
WordPress 中文包 sunshine Blog(博客)/Wiki(维客)/RSS/Cms 0 2007-03-12 10:16 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 02:47 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.