站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Tag Templates
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== 使用什么模板文件? == The first step in modifying what happens when someone visits a Category page is to figure out which of your theme's files is going to be used to display the posts. This is known as the [[WordPress:Template Hierarchy]]. 当有人浏览类别页面的时候,更改发生变化的第一步是要了解,将要使用你的哪个主题文件来显示文章。这也称为[[WordPress:Template Hierarchy|模板层级]]。 In the case of categories, the hierarchy is fairly simple. For instance, suppose the ID number of the Category in question is '''6'''. The Template Hierarchy specifies that WordPress will use the ''first'' Template file it finds in your current Theme's directory from the following list: #<tt style="font-weight:bold; color:#036">category-6.php</tt> #<tt style="font-weight:bold; color:#036">category.php</tt> #<tt style="font-weight:bold; color:#036">archive.php</tt> #<tt style="font-weight:bold; color:#036">index.php</tt> 关于类别,层级非常简单。例如,假如讨论的类别ID的数字是'''6'''。模板层级规定WordPress将会使用WordPress在下面的列表,你的当前主题目录中找到的''第一个''模板文件: #<tt style="font-weight:bold; color:#036">category-6.php</tt> #<tt style="font-weight:bold; color:#036">category.php</tt> #<tt style="font-weight:bold; color:#036">archive.php</tt> #<tt style="font-weight:bold; color:#036">index.php</tt> That is, if you do not have a <tt style="font-weight:bold; color:#036">category-6.php</tt>, WordPress will check for a <tt style="font-weight:bold; color:#036">category.php</tt>, and so on. 也就是说,如果你没有<tt style="font-weight:bold; color:#036">category-6.php</tt>,WordPress就会查看<tt style="font-weight:bold; color:#036">category.php</tt>,等等。 So, if you want to make the Category whose ID number is 6 look different from what it is currently (and different from other Category pages), you would want to create a <tt>category-6.php</tt> file. If you want to make all Category pages look different from other archive pages (such as date and author archives), then you would want to create or modify the <tt>category.php file</tt>. If you want to make changes to the look of all archive pages, you can create or modify the <tt>archive.php</tt> file. And if you modify the <tt>index.php</tt> file, you will affect your entire blog. 因此,如果你希望类别ID是6的类别看起来与当前类别页面不同(也与其它类别页面不同),你可能想要创建<tt>category-6.php</tt>文件。如果你希望所有的类别页面与其它归档页面看起来不同(例如日期和作者归档),那么你可能想要创建或者更改<tt>category.php file</tt>。如果你想要更改所有的归档页面的外观,你可以创建或者更改<tt>archive.php</tt>文件。而且如果你更改了<tt>index.php</tt>文件,你就会影响你的整个博客。 If you need to create a new file, it is a good idea to copy it from the next file in the hierarchy that exists. For instance, if you want a special display for Category 6, begin by copying the <tt>category.php</tt> file, or if you don't have one, use <tt>archive.php</tt>, and so on. 如果你需要创建新的文件,最后从存在的层级中的另一个文件中复制这个文件。例如,如果你想要特别地显示类别6,首先复制<tt>category.php</tt>文件,或者如果你没有这个文件,请使用<tt>archive.php</tt>,等等。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)