首页 » 我的文章 » 我的作品 » TStyle » 浏览内容

TStyle 主题文章内容分页

19992 33 发表评论
标签:

此说明是针对WordPress V3.05前的版本,3.05后的版本不一定适用。
以下是让文章能分页的修改方法,如果你觉得太麻烦不想自己修改,你也可以点这里下载我修改好的文件(仅适用于Wordpress v3.0-3.05)。

 

第一步:WordPress默认关闭了文章分页功能,所以首先要打开它。编辑 /wp-includes/js/quicktags.dev.js ,找到大概第131行,把这里的JS注释去掉。

 

第二步:编辑皮肤下的页面文件 /wp-content/themes/tstyle/single.php ,找到

<?php the_content(); ?>

在下面增加一行

<?php wp_link_pages('before=<p id="article-page">&pagelink=<em><span>%</span></em>'); ?>

请自行把以上代码的标点符号替换为英文半角。

 

第三步:添加分页所需的CSS,把以下CSS代码添加到 /wp-content/themes/tstyle/style.css 里,如果你不确定放在哪里,就放在最后面。

/* 文章分页 */
#article-cnt #article-page { clear: both; height: 28px; margin-left: 5px; padding: 15px 0 0; text-align: center; font-size: 10px; line-height: 20px; }
#article-page a { text-decoration: none; }
#article-page em { float: left; width: 22px; margin-right: 4px; position: relative; }
#article-page em span { display: block; width: 24px; height: 24px; margin: -2px 0 0 -2px; position: relative; background: #fff; border: 1px solid #ccc; text-decoration: none; font: bold 14px/24px arial, sans-serif; color: #c00; -webkit-box-shadow: 1px 1px 2px #ccc; -moz-box-shadow: 1px 1px 2px #ccc; -moz-border-radius: 0 4px 0 4px; -webkit-border-radius: 0 4px 0 4px; }
#article-page a em span { width: 20px; height: 20px; margin: 0; font: 10px/20px arial, sans-serif; color: #333; }
/* 文章分页结束 */

 

第四步:发表文章的时候,如果你想分页,就切换到HTML模式,在你想要分页的地方插入

<!--nextpage-->

(别复制这个标签,我做了字符替换,不一定是对的。),注意一定是在HTML模式下。

 

我修改的分页文件:nextpage.rar,下载后替换同名文件。
我在编辑器里增加了分页按钮,你可以不用切换到HTML模式输入分页符,直接按一下分页按钮就OK。

1 2 3 4 5

评论 共33条 (RSS 2.0) 发表评论

  1. weilongv 说道:

    你好,我按照你说的做了以后,在后台写文章的时候,只有HTML的界面了,而且看不见输入的文字,要用鼠标选中才能看见输入的内容?怎么办呢,谢谢

发表评论

  •   想要显示头像?
回到页首