WordPress: Templates:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: __TOC__ Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL da...)
 
无编辑摘要
第1行: 第1行:
__TOC__
__TOC__
Templates are the files which control how your WordPress site will be displayed on the Web.  These files draw information from your WordPress [[WordPress:Glossary#MySQL|MySQL]] database and generate the [[WordPress:Glossary#HTML|HTML]] code which is sent to the web browser.  Through its powerful [[WordPress:Using Themes|Theme]] system, WordPress allows you to define as few or as many Templates as you like all under one Theme.  Each of these Template files can be configured for use under specific situations.  More information on creating Themes can be found at [[WordPress:Theme Development]].
Templates are the files which control how your WordPress site will be displayed on the Web.  These files draw information from your WordPress [[WordPress:Glossary#MySQL|MySQL]] database and generate the [[WordPress:Glossary#HTML|HTML]] code which is sent to the web browser.  Through its powerful [[WordPress:Using Themes|Theme]] system, WordPress allows you to define as few or as many Templates as you like all under one Theme.  Each of these Template files can be configured for use under specific situations.  More information on creating Themes can be found at [[WordPress:Theme Development]].
模板是那些控制你的WordPress站点在网络上如何显示的文件. 这些文件从你的WordPress [[WordPress:Glossary#MySQL|MySQL]]数据库中提取数据,生成 [[WordPress:Glossary#HTML|HTML]] 代码,发送到网络浏览器. 通过强大的 [[WordPress:Using Themes|主题]] 系统, WordPress 允许你在一个主题下根据你的意愿定义任意数量模板。每个模板文件可以在某些特定的情况下配置使用。创建模板的更多信息参见[[WordPress:Theme Development|主题开发]].


== General Theme Articles ==
== General Theme Articles ==
第19行: 第21行:


; [[WordPress:Creating Admin Themes]] : How to create a plugin that modifies the look of the Admin section  
; [[WordPress:Creating Admin Themes]] : How to create a plugin that modifies the look of the Admin section  
== 一般主题文章==
; [[WordPress:Using Themes|使用主题]] : 关于使用和安装主题和模板的基本信息
; [[WordPress:Migrating Plugins and Themes|移动插件和主题]] : 包括关于为了与版本WordPress兼容如何更新的信息。
; [[WordPress:Theme Development|主题开发]] : 如何设计和开发你自己的主题。
; [[WordPress:Designing Themes for Public Release|给公开版本设计主题]] : 如何为公开版本设计开发WordPress 主题
; [[WordPress:Themes/Theme_Compatibility/2.2 | Version 2.2 主题兼容性列表]] :兼容 WordPress2.2版本的主题列表
; [[WordPress:Themes/Theme_Compatibility/2.3 | Version 2.3主题兼容性列表]] :兼容 WordPress2.3版本的主题列表
; [[WordPress:Site Architecture 1.5|站点结构1.5]] : 默认和经典主题的标准站点结构, 建议你在你的主题中遵循这一结构。
; [[WordPress:Creating Admin Themes|创建管理主题]] : 如何创建一个修改管理界面的插件


; External resources:  
; External resources:  
第33行: 第53行:
*  [http://mattread.com/archives/2005/04/wordpress-is-not-php/ WordPress is Not PHP - Template Files]
*  [http://mattread.com/archives/2005/04/wordpress-is-not-php/ WordPress is Not PHP - Template Files]
* [http://mattread.com/archives/2005/04/wordpress-is-not-php/#comment-1846 WordPress is PHP]
* [http://mattread.com/archives/2005/04/wordpress-is-not-php/#comment-1846 WordPress is PHP]
; 其他资源:
* [http://www.cypherhackz.net/archives/2006/12/13/make-your-own-wordpress-theme-part-1/ 制作你自己的Wordpress 主题 Fauzi Mohd Darus]
*[http://boren.nu/archives/2004/11/10/anatomy-of-a-wordpress-theme/ Ryan Boren 主题解析]
*[http://www.transycan.net/blogtest/2005/03/31/visual-anatomy-of-a-wp-15-theme/ Moshu WP v1.5主题视频解析]
*[http://www.chrisjdavis.org/2005/05/26/secrets-of-wp-theming-part-1/ Chris J. Davis  WP 主题的秘密, 第一部分]
*[http://www.chrisjdavis.org/2005/06/02/secrets-pt-2/ Chris J. Davis  WP 主题的秘密, 第二部分]
*[http://www.chrisjdavis.org/2005/06/13/secrets-pt-3/ Chris J. Davis  WP 主题的秘密, 第三部分]
* [http://www.urbangiraffe.com/2005/04/12/themeguide1/ WordPress 主题剖析]
*[http://www.codescheme.net/how-to-design-a-wordpress-theme/ 设计你的第一个WordPress 主题]
*[http://www.jestro.com/web-design/convert-xhtml-css-to-wordpress/ 如何转换基于XHTML/CSS的设计为 Wordpress 主题]
* [http://www.anekostudios.com/2006/09/21/how-to-create-a-wordpress-template-or-theme/ 如何创建一个WordPress 模板或者主题]
*  [http://mattread.com/archives/2005/04/wordpress-is-not-php/ WordPress 不是 PHP – 模板文件]
* [http://mattread.com/archives/2005/04/wordpress-is-not-php/#comment-1846 WordPress 是PHP]


== Template File Articles ==
== Template File Articles ==
第45行: 第79行:


; [[WordPress:The Loop in Action]] : More about the WordPress Loop
; [[WordPress:The Loop in Action]] : More about the WordPress Loop
== 模板文件文章 ==
=== 一般参考 ===
; [[WordPress:Stepping Into Templates|走进模板]] : [[WordPress:Using Themes|WordPress 主题]]构成模块的介绍, 模板文件。解释它们如何一起工作构成了网页,和模板文件如何可以包含在别的模板文件中。
; [[WordPress:Template Hierarchy|模板层次]] : 描述了为生成多种页面优先模板的顺序,简要的列出了在weblog中生成请求的页面过程中WordPress查看的多种模板。
; [[WordPress:The Loop|Loop]] : 描述了WordPress Loop, 它是生模板文件中生成内容的部分
; [[WordPress:The Loop in Action|运转的Loop]] : 更多关于WordPress Loop的信息


=== Header, Footer, Sidebar, and Content Sections ===
=== Header, Footer, Sidebar, and Content Sections ===
第67行: 第113行:


; [[WordPress:FAQ_Working_with_WordPress#Can_I_have_popup_comments.3F|Enabling Popup Comments]]: How to make comments come in a pop-up window
; [[WordPress:FAQ_Working_with_WordPress#Can_I_have_popup_comments.3F|Enabling Popup Comments]]: How to make comments come in a pop-up window
=== 页眉,页脚,边栏和目录===
;[[WordPress:Designing Headers|设计页眉]] :定义<tt>header.php</tt>模板文件.
;[[WordPress:Adding Post Feeds to the Header|在页眉添加文章feed]] : 如何添加 RSS feed 链接到页眉模板文件
;[[WordPress:Customizing Your Sidebar|定义边栏]] :定义<tt>sidebar.php</tt> 模板文件.
;[[WordPress:Customizing the Read More|定义阅读更多]] : 在你的摘录中定义阅读更多链接的外观。
;[[WordPress:Next and Previous Links|下一个和上一个链接]] : 定义上一个/下一个文章/页面链接的外观
;[[WordPress:Styling Page-Links|设计页面链接]] : 如何把一篇文章分成几个页面以及定义它们的链接
;[[WordPress:Separating Categories|把分类分开]] : 在你的文章中的分类中定义分隔符
;[[WordPress:Using Custom Fields|使用自定义域]] : 如何添加定义meta-data 到你的blog文章以及如何显示它们
;[[WordPress:Adding Asides|添加边注]] : 如何添加边注到blog文章中
; [[WordPress:FAQ_Working_with_WordPress#Can_I_have_popup_comments.3F|激活弹出窗口评论]]: 如何让评论出现在弹出窗口中


=== Archives, Categories, and Special Pages ===
=== Archives, Categories, and Special Pages ===
第92行: 第160行:
;External Resources:  
;External Resources:  
* [http://www.cameraontheroad.com/?p=623 Creating Multiple Single Posts for Different Categories]
* [http://www.cameraontheroad.com/?p=623 Creating Multiple Single Posts for Different Categories]
=== 文档, 分类, 和特别页面 ===
;[[WordPress:Creating a Static Front Page|创建静态首页]] : 如何制作一个静态主页或者splash 页面
;[[WordPress:Author Templates|作者模板]] :定义<tt>author.php</tt> 显示作者信息和作者文章的模板文件。
; [[WordPress:Category Templates|分类模板]] :关于为多种分类文章定义和制定模板。
; [[WordPress:Alphabetizing Posts|按字母顺序排列文章]] : 如何让分类页面按字母顺序排列而不用时间顺序排列
;[[WordPress:Creating an Archive Index|创建文档索引]] :定义<tt>archives.php</tt> 模板文件,它根据日期显示文章.
;[[WordPress:Pages|页面]] : 描述WordPress 页面, 模板与页面功能之间的关系.
; [[WordPress:Styling Theme Forms|设计主题格式]] : 描述如何在模板中给评论,搜索等等设计格式.
;[[WordPress:Creating a Search Page|创建搜索页面]] :定义<tt>search.php</tt> 模板文件.
;[[WordPress:Creating an Error 404 Page|创建一个错误404页面]] :创建一个带有错误404页面模板文件页面.
;[[WordPress:Displaying Posts Using a Custom Select Query|使用选择查询显示文章]]: 修改哪个文章显示在页面上。
;其他资源:
* [http://www.cameraontheroad.com/?p=623 为不同的分类创建多个单独文章]


== Template Tags Articles==
== Template Tags Articles==
第113行: 第206行:
* [http://www.headzoo.com/wptcs.png Theme cheatsheet]
* [http://www.headzoo.com/wptcs.png Theme cheatsheet]
* [http://florchakh.com/2007/04/17/mashup-of-posts-on-your-wordpress-homepage.html Using the_content and the_excerpt tags within the Loop at the same time].
* [http://florchakh.com/2007/04/17/mashup-of-posts-on-your-wordpress-homepage.html Using the_content and the_excerpt tags within the Loop at the same time].
== 模板标签文章==
; [[WordPress:Stepping Into Template Tags|走进模板标签]] :介绍模板文件中模板标签的使用.
; [[WordPress:Template Tags|模板标签]] : 最主要的功能就是用来获取数据库信息并在网页上显示。例如,一个文章的内容显示需要模板标签 <tt>[[WordPress:Template Tags/the_content|the_content()]]</tt>.
; [[WordPress:Template_Tags/Anatomy_of_a_Template_Tag|模板标签解析]] :理解模板文件中使用的模板标签的结构,用法和参数。
; [[WordPress:Include Tags|包括标签]] : 描述可以包括并使用WordPress模板文件的标签的文档。
; [[WordPress:Conditional Tags|条件式标签]] :  这些标签(通常是以 <tt>is_''something''()</tt>这种格式出现的, 如<tt>[[WordPress:Conditional Tags#The Main Page|is_home()]]</tt>)报告哪种页面正在显示,(如主页,分类文档等等) 根据标签的报告,选择哪种页面可以在模板中用来控制模板输出。
; [[WordPress:Template_Tags/query_posts|查询文章模板标签]] : 描述 <tt>query_posts</tt> 模板标签, 用来控制页面上显示哪个文章。
;[[WordPress:Template_Tags/wp_list_pages|列出页面模板标签]] : 描述了<tt>wp_list_pages()</tt> 模板标签,用来创建页面列表。
;其他资源:
*[http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/ 模板和"is" 函数  Ryan]
* [http://www.headzoo.com/wptcs.png 主题cheatsheet]
* [http://florchakh.com/2007/04/17/mashup-of-posts-on-your-wordpress-homepage.html 在Loop中同时使用the_content 和 the_excerpt标签].


==CSS, Design, and Layout==
==CSS, Design, and Layout==
第128行: 第243行:
*[http://www.informaticafriuli.com/category/web-friuli/template-informatica-friuli/  informaticafriuli.com]:Free wordpress theme and template.
*[http://www.informaticafriuli.com/category/web-friuli/template-informatica-friuli/  informaticafriuli.com]:Free wordpress theme and template.
*[http://animalphotos.info/a/ Animal Photos]: Animal Photos under a creative commons license
*[http://animalphotos.info/a/ Animal Photos]: Animal Photos under a creative commons license
==CSS, 设计, 和版面==
; [[WordPress:CSS|CSS]] : 如何结合CSS与WordPress, 以及其他WordPress CSS 参数
; [[WordPress:Blog Design and Layout|blog设计与版面]] : WordPress设计和版面的文章和资源列表
; [[WordPress:Know Your Sources#CSS|了解你的资源#CSS]] : 一般CSS参考列表
;其他资源:
* [http://flumpcakes.co.uk/css/optimiser/ Flumpcakes CSS 优化] – 定义你的CSS文件。 ''包括"对运行不安全" 页眉图片.''
*[http://creativecommons.org/image/ 创建公共图片]:公共图片搜索是在线免费共享使用的。
*[http://www.imageafter.com/ Image * After]:免费的商用或者个人用的图片库.
*[http://www.sxc.hu/ stock.xchng]:免费使用的照片.
*[http://www.freedigitalphotos.net freedigitalphotos.net]:商用或非商用免费照片.
*[http://www.informaticafriuli.com/category/web-friuli/template-informatica-friuli/  informaticafriuli.com]:免费wordpress 主题和模板.
*[http://animalphotos.info/a/ 动物照片]: 拥有creative commons license的动物照片


== Tools, Testing and Validating==
== Tools, Testing and Validating==
第135行: 第265行:
; [[WordPress:Validating a Website]]
; [[WordPress:Validating a Website]]
; [[WordPress:Glossary#Text_editor|Plain Text Editors]] :A list of plain text editors for all platforms.
; [[WordPress:Glossary#Text_editor|Plain Text Editors]] :A list of plain text editors for all platforms.
== 工具, 测试和验证==
; [[WordPress:CSS Fixing_Browser Bugs|CSS修正浏览器错误]]
; [[WordPress:CSS Troubleshooting|CSS错误发现并解决]]
; [[WordPress:Validating a Website|验证网站]]
; [[WordPress:Glossary#Text_editor|纯文本编辑器]] :所有平台上的纯文本编辑器列表

2008年5月4日 (日) 08:47的版本

Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme. Each of these Template files can be configured for use under specific situations. More information on creating Themes can be found at WordPress:Theme Development.

模板是那些控制你的WordPress站点在网络上如何显示的文件. 这些文件从你的WordPress MySQL数据库中提取数据,生成 HTML 代码,发送到网络浏览器. 通过强大的 主题 系统, WordPress 允许你在一个主题下根据你的意愿定义任意数量模板。每个模板文件可以在某些特定的情况下配置使用。创建模板的更多信息参见主题开发.

General Theme Articles

WordPress:Using Themes
Basic information about using and installing Themes and Templates
WordPress:Migrating Plugins and Themes
Contains information on how to upgrade a Theme for compatibility with new versions of WordPress
WordPress:Theme Development
How to design and develop your own themes
WordPress:Designing Themes for Public Release
How to design and develop WordPress Themes for public release
Version 2.2 Theme Compatibility List
List of which Themes are compatible with Version 2.2 of WordPress
Version 2.3 Theme Compatibility List
List of which Themes are compatible with Version 2.3 of WordPress
WordPress:Site Architecture 1.5
Standard site architecture of the Default and Classic themes, which you are encouraged to follow in your Themes
WordPress:Creating Admin Themes
How to create a plugin that modifies the look of the Admin section

一般主题文章

使用主题
关于使用和安装主题和模板的基本信息
移动插件和主题
包括关于为了与版本WordPress兼容如何更新的信息。
主题开发
如何设计和开发你自己的主题。
给公开版本设计主题
如何为公开版本设计开发WordPress 主题
Version 2.2 主题兼容性列表
兼容 WordPress2.2版本的主题列表
Version 2.3主题兼容性列表
兼容 WordPress2.3版本的主题列表
站点结构1.5
默认和经典主题的标准站点结构, 建议你在你的主题中遵循这一结构。
创建管理主题
如何创建一个修改管理界面的插件
External resources
其他资源

Template File Articles

General References

WordPress:Stepping Into Templates
Introduction to the building blocks of WordPress Themes, the template files. Explains how they work together to build a web page and how template files can be included in other template files.
WordPress:Template Hierarchy
Description of the order of preference of templates for the generation of various pages. Briefly lists the various templates that WordPress checks for in the process of generating a requested page on the weblog.
WordPress:The Loop
Description of the WordPress Loop, which is the part of a template file that generates the content
WordPress:The Loop in Action
More about the WordPress Loop

模板文件文章

一般参考

走进模板
WordPress 主题构成模块的介绍, 模板文件。解释它们如何一起工作构成了网页,和模板文件如何可以包含在别的模板文件中。
模板层次
描述了为生成多种页面优先模板的顺序,简要的列出了在weblog中生成请求的页面过程中WordPress查看的多种模板。
Loop
描述了WordPress Loop, 它是生模板文件中生成内容的部分
运转的Loop
更多关于WordPress Loop的信息

Header, Footer, Sidebar, and Content Sections

WordPress:Designing Headers
Customizing the header.php template file.
WordPress:Adding Post Feeds to the Header
How to add RSS feed links to your header template file
WordPress:Customizing Your Sidebar
Customizing the sidebar.php template file.
WordPress:Customizing the Read More
Customizing the look of Read More links on your excerpts
WordPress:Next and Previous Links
Customizing the look of next/previous post/page links
WordPress:Styling Page-Links
How to break up single posts into multiple pages, and customize their links
WordPress:Separating Categories
Putting custom separators in the category list for your posts
WordPress:Using Custom Fields
How to add custom meta-data to your blog posts, and how to display it
WordPress:Adding Asides
How to add side notes to your blog posts
Enabling Popup Comments
How to make comments come in a pop-up window

页眉,页脚,边栏和目录

设计页眉
定义header.php模板文件.
在页眉添加文章feed
如何添加 RSS feed 链接到页眉模板文件
定义边栏
定义sidebar.php 模板文件.
定义阅读更多
在你的摘录中定义阅读更多链接的外观。
下一个和上一个链接
定义上一个/下一个文章/页面链接的外观
设计页面链接
如何把一篇文章分成几个页面以及定义它们的链接
把分类分开
在你的文章中的分类中定义分隔符
使用自定义域
如何添加定义meta-data 到你的blog文章以及如何显示它们
添加边注
如何添加边注到blog文章中
激活弹出窗口评论
如何让评论出现在弹出窗口中

Archives, Categories, and Special Pages

WordPress:Creating a Static Front Page
How to make a static home page, or splash page, for your blog
WordPress:Author Templates
Customizing the author.php template file which showcases information about the author and their posts.
WordPress:Category Templates
All about defining and customizing templates for the various category archives on your weblog.
WordPress:Alphabetizing Posts
How to make a category page use alphabetical rather than chronological order
WordPress:Creating an Archive Index
Customizing the archives.php template file which showcases posts by date.
WordPress:Pages
Describes WordPress Pages, and the relationship between Templates and Pages feature.
WordPress:Styling Theme Forms
Describes how to make forms in your templates for comments, search, etc.
WordPress:Creating a Search Page
Customizing the search.php template file.
WordPress:Creating an Error 404 Page
Creating a template file Page to feature a customized Error 404 Page.
WordPress:Displaying Posts Using a Custom Select Query
Modifying which posts are displayed on a page
External Resources

文档, 分类, 和特别页面

创建静态首页
如何制作一个静态主页或者splash 页面
作者模板
定义author.php 显示作者信息和作者文章的模板文件。
分类模板
关于为多种分类文章定义和制定模板。
按字母顺序排列文章
如何让分类页面按字母顺序排列而不用时间顺序排列
创建文档索引
定义archives.php 模板文件,它根据日期显示文章.
页面
描述WordPress 页面, 模板与页面功能之间的关系.
设计主题格式
描述如何在模板中给评论,搜索等等设计格式.
创建搜索页面
定义search.php 模板文件.
创建一个错误404页面
创建一个带有错误404页面模板文件页面.
使用选择查询显示文章
修改哪个文章显示在页面上。
其他资源

Template Tags Articles

WordPress:Stepping Into Template Tags
Introduction to the use of template tags in template files.
WordPress:Template Tags
The core set of functions used to draw information from the database and display it on the web. For example, the Content of a Post is displayed with the Template Tag the_content().
Anatomy of a Template Tag
Understanding the structure, usage, and parameters of template tags used in template files.
WordPress:Include Tags
A document describing the tags that are available to include and use WordPress' template files.
WordPress:Conditional Tags
These tags (always of the form is_something(), such as is_home()), report what sort of page is being displayed (e.g. the Main Page, a Category Archive, etc.) and can be used within a Template to control the Template's output depending on what the tags report.
Query Posts Template Tag
A description of the query_posts template tag, which is used to control which posts are displayed on a page
List Pages Template Tag
A description of the wp_list_pages() template tag used to create a list of Pages.
External Resources

模板标签文章

走进模板标签
介绍模板文件中模板标签的使用.
模板标签
最主要的功能就是用来获取数据库信息并在网页上显示。例如,一个文章的内容显示需要模板标签 the_content().
模板标签解析
理解模板文件中使用的模板标签的结构,用法和参数。
包括标签
描述可以包括并使用WordPress模板文件的标签的文档。
条件式标签
这些标签(通常是以 is_something()这种格式出现的, 如is_home())报告哪种页面正在显示,(如主页,分类文档等等) 根据标签的报告,选择哪种页面可以在模板中用来控制模板输出。
查询文章模板标签
描述 query_posts 模板标签, 用来控制页面上显示哪个文章。
列出页面模板标签
描述了wp_list_pages() 模板标签,用来创建页面列表。
其他资源


CSS, Design, and Layout

WordPress:CSS
How to integrate CSS into WordPress, with list of other WordPress CSS references
WordPress:Blog Design and Layout
List of articles and resources for WordPress blog design, and layout
WordPress:Know Your Sources#CSS
List of general CSS references
External Resources

CSS, 设计, 和版面

CSS
如何结合CSS与WordPress, 以及其他WordPress CSS 参数
blog设计与版面
WordPress设计和版面的文章和资源列表
了解你的资源#CSS
一般CSS参考列表
其他资源

Tools, Testing and Validating

WordPress:CSS Fixing_Browser Bugs
WordPress:CSS Troubleshooting
WordPress:Validating a Website
Plain Text Editors
A list of plain text editors for all platforms.

工具, 测试和验证

CSS修正浏览器错误
CSS错误发现并解决
验证网站
纯文本编辑器
所有平台上的纯文本编辑器列表