站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Alphabetizing Posts
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
===特别类别模板=== If you want your "Glossary" category to have a very different style from the rest of your site, you could create a custom category template file just for it. First, find the category ID of your "Glossary" category. The category ID is listed in the left-most column of your [[WordPress:Administration_Panels#Manage_-_Change_your_content|Manage]] > [[WordPress:Administration_Panels#Categories|Categories]] administration panel. For this example, we'll assume that the "Glossary" category has a category ID of 13. 如果你希望"术语表"类别的样式与站点的其它部分的样式不同,你可以为术语表创建一个自定义类别模板文件。首先,找到你的"术语表"类别的ID。类别ID列在[[WordPress:Administration_Panels#Manage_-_Change_your_content|管理]] > [[WordPress:Administration_Panels#Categories|类别]]管理面板最左边的栏中。在这个例子中,我们假定"术语表"类别的ID是13. Copy your theme's <tt>index.php</tt> or <tt>category.php</tt> file (or create a brand new file, if necessary) named <strong><tt>category-13.php</tt></strong>, and insert your code as needed: 复制你的主题的<tt>index.php</tt> 或者 <tt>category.php</tt> 文件(或者如果必须的话,创建一个新文件)命名为<strong><tt>category-13.php</tt></strong>,如果需要的话,插入你的代码: <pre> <?php get_header(); ?> <div id="content"> <?php // we add this, to show all posts in our // Glossary sorted alphabetically $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); // here comes The Loop! if (have_posts()) : while (have_posts()) : the_post(); ?> </pre> <pre> <?php get_header(); ?> <div id="content"> <?php // 我们添加这个, //以字母表顺序,在术语表中显示所有文章 $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); // 下面是Loop! if (have_posts()) : while (have_posts()) : the_post(); ?> </pre> Using a separate category template file for your "Glossary" category means that you do not clutter up your main <tt>category.php</tt> file with a bunch of conditional template tags. 为你的"术语表"类别使用单独的类别模板文件,意味着你不需要将主要的<tt>category.php</tt>文件和一些条件式标签混乱在一起。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)