WordPress: Themes:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: __TOC__ Before the advent of Themes, WordPress generated content using a single file, <tt>index.php</tt>, and files to support comment display and submission. A single style sheet control...)
 
无编辑摘要
 
第1行: 第1行:
__TOC__
__TOC__
__TOC__
Before the advent of Themes, WordPress generated content using a single file, <tt>index.php</tt>, and files to support comment display and submission. A single style sheet controlled the presentation. All other pages, including the category and archive pages, were generated by passing parameters to the <tt>index.php</tt> page.  
Before the advent of Themes, WordPress generated content using a single file, <tt>index.php</tt>, and files to support comment display and submission. A single style sheet controlled the presentation. All other pages, including the category and archive pages, were generated by passing parameters to the <tt>index.php</tt> page.  
在主题出现之前,WordPress使用单一的文件<tt>index.php</tt>创建内容,并且使用文件,递交和显示评论。单一的样式表控制外观。所有其它的网页,包括类别和归档网页,是通过将参数传递到<tt>index.php</tt>页面,产生的。


The new Theme system provides two convenient features.   
The new Theme system provides two convenient features.   
新的主题系统提供了两个方便的功能。


; Physically Separate Components :The new WordPress modular [[WordPress:Stepping Into Templates|template files]] system provides a method to define separate physical [[WordPress:Glossary#PHP|PHP]] files for the different components of your WordPress site. This allows creation of unique designs and functionality for many special pages, such as [[WordPress:Category Templates|category archives]], [[WordPress:Creating_an_Archive_Index|monthly archives]], and the individual entry pages.
; Physically Separate Components :The new WordPress modular [[WordPress:Stepping Into Templates|template files]] system provides a method to define separate physical [[WordPress:Glossary#PHP|PHP]] files for the different components of your WordPress site. This allows creation of unique designs and functionality for many special pages, such as [[WordPress:Category Templates|category archives]], [[WordPress:Creating_an_Archive_Index|monthly archives]], and the individual entry pages.
;分开组成部分:新的WordPress模块[[WordPress:Stepping Into Templates|模板 文件]]系统提供了一种方法,为WordPress站点的不同部分,定义不同的[[WordPress:Glossary#PHP|PHP]]文件。这样能够为许多特别的网页创建独一的设计和功能,例如[[WordPress:Category Templates|类别归档]], [[WordPress:Creating_an_Archive_Index|按月归档]],以及只有一篇文章的网页。
;Quickly Change Layout and Design :It allows users with appropriate permissions to quickly change the layout of the entire site by uploading a new theme and essentially flipping a switch in the admin panel.
;Quickly Change Layout and Design :It allows users with appropriate permissions to quickly change the layout of the entire site by uploading a new theme and essentially flipping a switch in the admin panel.


;快速地更改布局和设计:拥有一定权限的用户,通过上传一个新的主题,按一下管理面板中的按钮,就可以快速地更改整个站点的布局和设计。
The old method of generating pages will still work. If you are [[WordPress:Upgrade_1.2_to_1.5|upgrading from v1.2 or v1.2.1 or v1.2.2]], '''you can continue using your existing design'''.  Keeping your older design will not prevent you from adding additional themes and easily switching between designs.  
The old method of generating pages will still work. If you are [[WordPress:Upgrade_1.2_to_1.5|upgrading from v1.2 or v1.2.1 or v1.2.2]], '''you can continue using your existing design'''.  Keeping your older design will not prevent you from adding additional themes and easily switching between designs.  
创建网页的旧方法仍然适用。如果你从[[WordPress:Upgrade_1.2_to_1.5|1.2或者1.2.1或者1.2.2版本升级]],'''你可以继续使用当前的设计'''。保持旧的样式,你仍然能够添加主题并且轻易地切换样式。


==What is a Theme?==
==What is a Theme?==
==主题是什么?==


Fundamentally, the WordPress Theme system is a way to "skin" your weblog. Yet, it is more than just a "skin." Skinning your site implies that only the design is changed. WordPress Themes can provide much more control over the look ''and presentation'' of the material on your website.
Fundamentally, the WordPress Theme system is a way to "skin" your weblog. Yet, it is more than just a "skin." Skinning your site implies that only the design is changed. WordPress Themes can provide much more control over the look ''and presentation'' of the material on your website.
一般来说,WordPress主题系统是"包装"你的博客外观的方式。但是,主题不仅起着"包装"作用。包装你的站点暗示只有设计更改了。WordPress能够更多地控制你的网站上的材料的外观''和呈现方式''。


A WordPress Theme is a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called [[WordPress:Templates|'''template files''']]. A theme modifies the way the site is displayed, without modifying the underlying software. Themes may include customized template files, image files (<tt>*.jpg</tt>, <tt>*.gif</tt>), style sheets (<tt>*.css</tt>), custom [[WordPress:Pages]], as well as any necessary code files (<tt>*.php</tt>). For an introduction to template files, see [[WordPress:Stepping Into Templates]].
A WordPress Theme is a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called [[WordPress:Templates|'''template files''']]. A theme modifies the way the site is displayed, without modifying the underlying software. Themes may include customized template files, image files (<tt>*.jpg</tt>, <tt>*.gif</tt>), style sheets (<tt>*.css</tt>), custom [[WordPress:Pages]], as well as any necessary code files (<tt>*.php</tt>). For an introduction to template files, see [[WordPress:Stepping Into Templates]].


WordPress主题指的是一些文件的集合,这些文件一起运行,输出一种图形界面,这个图形界面拥有网页日志的潜在的统一的设计。这些文件称为[[WordPress:Templates|'''模板文件''']]。主题可以更改站点的显示方式,但是不会更改潜在的软件。主题可能包含自定义的模板文件,图像文件(<tt>*.jpg</tt>, <tt>*.gif</tt>),样式表(<tt>*.css</tt>),自定义[[WordPress:Pages|网页]],以及任何必要的代码文件(<tt>*.php</tt>)。关于模板文件的介绍,请看看[[WordPress:Stepping Into Templates|走进模板]]。
Themes are a whole new ball game. Let's say you write a lot about cheese and gadgets. Through the innovative use of the [[WordPress:The Loop|WordPress Loop]] and [[WordPress:Templates|template files]], you can customize your Cheese category posts to look different from your Gadgets category posts. With this powerful control over what different pages and categories look like on your site, you are limited only by your imagination. For information on how to use different Themes for different categories or posts, see [[WordPress:The Loop in Action]] and [[WordPress:Category Templates]].
Themes are a whole new ball game. Let's say you write a lot about cheese and gadgets. Through the innovative use of the [[WordPress:The Loop|WordPress Loop]] and [[WordPress:Templates|template files]], you can customize your Cheese category posts to look different from your Gadgets category posts. With this powerful control over what different pages and categories look like on your site, you are limited only by your imagination. For information on how to use different Themes for different categories or posts, see [[WordPress:The Loop in Action]] and [[WordPress:Category Templates]].
主题是一种全新的情况。假如你写了许多关于奶酪和gadgets的文章。通常创新性地使用[[WordPress:The Loop|WordPress Loop]] 和[[WordPress:Templates|模板文件]],你可以自定义你的奶酪类别文章,使得这些文章与你的Gadgets文章看起来不同。能够控制站点上的不同网页和类别的外观之后,你只会受你的想象力的限制了。关于怎样为不同的类别和文章使用不同的主题,请看看[[WordPress:The Loop in Action|运转的Loop]] 和[[WordPress:Category Templates|类别模板]]。


==Get New Themes==
==Get New Themes==
==得到新的主题==


The [http://themes.wordpress.net/ WordPress Theme Viewer] is the official site for WordPress Themes which have been checked and inspected, and are free for downloading. The site features the ability to search by type and style, and offers a demonstration of the page view elements of the Theme.
The [http://themes.wordpress.net/ WordPress Theme Viewer] is the official site for WordPress Themes which have been checked and inspected, and are free for downloading. The site features the ability to search by type and style, and offers a demonstration of the page view elements of the Theme.
[http://themes.wordpress.net/ WordPress Theme Viewer]是WordPress主题的官方站点,这个站点中的主题得到审查,而且可以免费下载。你可以在这个站点上通过主题的类型和样式搜索主题,而且可以看到主题的网页浏览元素。


Other sources for WordPress Themes may include:
Other sources for WordPress Themes may include:
WordPress主题的其它资源,包括:
* [http://www.wordpresstheme.com/ WordPressTheme.com]
* [http://www.wordpresstheme.com/ WordPressTheme.com]
* [http://www.wordpresswow.com WordPress Wow Themes Gallery]
* [http://www.wordpresswow.com WordPress Wow Themes Gallery]
第70行: 第96行:
* [http://www.ericulous.com/ Smashing Wordpress Themes]
* [http://www.ericulous.com/ Smashing Wordpress Themes]
* [http://www.balkhis.com/category/wp-themes/ Balkhis Wordpress Themes]
* [http://www.balkhis.com/category/wp-themes/ Balkhis Wordpress Themes]
* [http://www.wordpresstheme.com/ WordPressTheme.com]
* [http://www.wordpresswow.com WordPress Wow 主题库]
* [http://wordpress.org/support/forum.php?id=5 WordPress 支持主题论坛]
* [http://wordpress-themes.chromaticsites.com/ 专业的WordPress主题]
* [http://wpgarden.com/ WordPress Garden - Theme 浏览]
* [http://www.lukaret.com/wordpress-themes/ Beng Hafner创建的WordPress主题]
* [http://www.bestwpthemes.com/ 最好的 WordPress 主题]
* [http://themes.rock-kitty.net 免费的 Wordpress 主题 – Kate的主题浏览器]
* [http://www.einternetindex.com/themes/ 免费的 Wp 主题]
* [http://templatextreme.com/products/wordpress-themes/ TemplateXtreme上免费的WordPress主题]
* [http://www.bloggingpro.com/archives/category/wordpress-themes/ Blogging Pro WordPress主题类别]
* [http://wpdemo.kaushalsheth.com/ Kaushal Sheth的WordPress 主题浏览器]
* [http://biboz.net/themes/ biboz.net 免费的 WordPress 主题]
* [http://wpthemes.info/themes/ Sadish的WP主题]
* [http://www.gii.in/themes/ Gii 主题]
* [http://www.skinsforwp.com/free-wordpress-themes.html Skins/ WordPress主题]
* [http://www.prissed.com/ priss的WordPress主题]
* [http://www.gfxedit.com/themes/wordpress/ GFXedit.com 主题]
* [http://www.dirsurfer.com/blog/wp-free-templates/ Dirsurfer 主题]
*[http://www.emilyrobbins.com/how-to-blog/comprehensive-list-of-615-free-wordpress-15-and-20-themes-templates-available-for-download-266.htm How to Blog's List of 980+ 主题]
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex King's WordPress 主题竞赛]
* [http://www.johntp.com/wp-skins/ JohnTP的WordPress 主题集]
* [http://gallery.wordpress.com/ Gallery for WordPress]
* [http://www.headsetoptions.org/ Headsetoptions WP Themes]
* [http://www.mandarinmusing.com/ Mandarinmusing WP Themes]
* [http://themez.info/ WordPress主题]
* [http://www.yvoschaap.com/wpthemegen/ Yvo Schapp's WordPress Theme Generator]
* [http://www.livelydirectory.com/blog/ 免费的 WordPress 主题]
* [http://milo.peety-passion.com/ miloIIIIVII]
* [http://www.reviewmytheme.com/ ReviewMyTheme免费的WordPress 模板]
* [http://www.allinfodir.com/themes/ AllinfoDir WP 主题]
* [http://www.idk.in/blogs/?cat=14真正的WP 主题]
* [http://www.elegantdirectory.com/wp-themes/ ElegantDirectory WordPress 主题]
* [http://blog.rakcha.com/category/themes/ High Quality Themes from rakCha]
* [http://www.avivadirectory.com/downloads/category/wordpress-themes/ Aviva WordPress 主题]
* [http://www.dirjournal.com/wp-themes/ Free Sponsored主题]
* [http://www.templatesfactory.net/blog/category/wp-themes/ 免费的WP主题]
* [http://www.wpthemesfree.com 免费的Wordpress主题]
* [http://blogosquare.com/wordpress-themes/ BlogoSquare 免费主题下载及浏览]
* [http://www.get-index.com/wordpress-themes/ 免费的 WordPress主题]
* [http://www.ventedoy.com/themes/ 免费的高质量的 Wordpress主题]
* [http://www.madmouse-extreme-directory.com/blog/?cat=11/ Madmouse Extreme Blog - WordPress 文章和主题]
* [http://www.themevibes.com 免费的WorPpress主题]
* [http://www.mygreencorner.com/freewordpressthemes.php 免费的WordPress主题]
* [http://www.jauhari.net/themes免费的 WordPress主题]
* [http://www.wpmix.com/ Wordpress主题]
* [http://www.ericulous.com/ Smashing Wordpress 主题]
* [http://www.balkhis.com/category/wp-themes/ Balkhis Wordpress 主题]


==Using Themes==
==Using Themes==
==使用主题==


WordPress supplies two themes in its distribution for your initial use.  You can switch between these two themes using the admin panel.  Themes that you add to that directory will appear in the [[WordPress:Administration Panels]] > [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]] as additional selections.
WordPress supplies two themes in its distribution for your initial use.  You can switch between these two themes using the admin panel.  Themes that you add to that directory will appear in the [[WordPress:Administration Panels]] > [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]] as additional selections.
你开始使用时,就可以使用WordPress发行的两个主题。你可以使用管理面板,切换使用两个主题。你添加到目录中的主题会出现在[[WordPress:Administration Panels|管理面板]] > [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]]中,作为额外的选项。


===Adding New Themes===
===Adding New Themes===
===添加新的主题===


There are many themes available for download that will work with your WordPress installation.
There are many themes available for download that will work with your WordPress installation.
可以下载许多主题,在WordPress中运行。


[[WordPress:Image:presentthemes1.png|thumb|right|Presentation Theme Panel]]If the theme that you are installing provides instructions, be sure to read through and follow those instructions for the successful installation of the theme.  '''It is recommended that theme developers provide installation instructions for their own themes''', because themes can provide special optional functionality that may require more steps than the basic installation steps covered here.  If your theme does not work after following any provided instructions, please '''contact the theme author for help'''.
[[WordPress:Image:presentthemes1.png|thumb|right|Presentation Theme Panel]]If the theme that you are installing provides instructions, be sure to read through and follow those instructions for the successful installation of the theme.  '''It is recommended that theme developers provide installation instructions for their own themes''', because themes can provide special optional functionality that may require more steps than the basic installation steps covered here.  If your theme does not work after following any provided instructions, please '''contact the theme author for help'''.
[[WordPress:Image:presentthemes1.png|thumb|right|Presentation 主题面板]]如果你安装的主题提供了指示说明,要确定通读这些说明,并且遵循这些说明,以成功地安装主题。'''建议主题开发人员,为自己的主题提供安装说明''',因为主题提供了特别的可选择的功能,这些功能的安装比基本的安装步骤可能更复杂。如果你遵循了任何的说明之后,你的主题仍然不能够运行,请'''联系主题作者,寻求帮助'''。


To add a new theme to your WordPress installation, follow these basic steps:
To add a new theme to your WordPress installation, follow these basic steps:
要为你的WordPress添加一个新的主题,请遵循下面的基本步骤:


# Download the theme archive and extract the files it contains.  You may need to preserve the directory structure in the archive when extracting these files.  Follow the guidelines provided by your theme author.
# Download the theme archive and extract the files it contains.  You may need to preserve the directory structure in the archive when extracting these files.  Follow the guidelines provided by your theme author.
#下载主题归档并且解压这些归档所包含的文件。解压这些文件的时候,你可能需要在归档中保存这些目录结构。遵循主题作者提供的指导。
# Using an [[WordPress:FTP_Clients|FTP client]] to access your host web server, create a directory to contain your theme in the <tt>wp-content/themes</tt> directory provided by WordPress.  For example, a theme named '''Test''' should be in <tt>wp-content/themes/test</tt>.  Your theme may provide this directory as part of the archive.
# Using an [[WordPress:FTP_Clients|FTP client]] to access your host web server, create a directory to contain your theme in the <tt>wp-content/themes</tt> directory provided by WordPress.  For example, a theme named '''Test''' should be in <tt>wp-content/themes/test</tt>.  Your theme may provide this directory as part of the archive.
#使用[[WordPress:FTP_Clients|FTP client]]访问你的主机网络服务器,创建一个目录,将主题包含在WordPress提供的<tt>wp-content/themes</tt>目录。例如,一个名为'''测试'''的主题应该包含在<tt>wp-content/themes/test</tt>。你的主题应该提供这个目录,作为归档的一部分。
# Upload the theme files to the new directory on your host server.
# Upload the theme files to the new directory on your host server.
#将主题文件上传到你的主机服务器的新目录中。
# Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
# Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示]]选择新的主题。
====Adding New Themes in cPanel ====
====Adding New Themes in cPanel ====
====在 cPanel 中添加新的主题====
If your host offers the [[WordPress:Glossary#cPanel|cPanel]] control panel, and the theme files are in a .zip or .gz archive follow these instructions.  Note:  This assumes the theme you download is a compressed (zip) file and the files in the zip file are in their 'named' folder.
If your host offers the [[WordPress:Glossary#cPanel|cPanel]] control panel, and the theme files are in a .zip or .gz archive follow these instructions.  Note:  This assumes the theme you download is a compressed (zip) file and the files in the zip file are in their 'named' folder.
如果你的主机提供[[WordPress:Glossary#cPanel|cPanel]]控制面板,而且主题文件在.zip 或者 .gz归档中,遵循这些指示说明。注:这个前提是你下载的主题是个压缩文件而且压缩文件中的文件在'指定的'文件夹中。
# Download the theme zip file to your local machine.
# Download the theme zip file to your local machine.
#将主题压缩文件下载到你的本地电脑上。
# In cPanel File Manager, navigate to your themes folder.  If you have WordPress installed in it's own folder called wordpress, you would navigate to "public_html/wordpress/wp-content/themes" and if WordPress is installed in your web-root folder you would navigate to "public_html/wp-content/themes".
# In cPanel File Manager, navigate to your themes folder.  If you have WordPress installed in it's own folder called wordpress, you would navigate to "public_html/wordpress/wp-content/themes" and if WordPress is installed in your web-root folder you would navigate to "public_html/wp-content/themes".
#在cPanel文件管理器中,导航到当你主题文件夹。如果你将WordPress安装在其自身称为wordpress的文件夹中,你将会导航到"public_html/wordpress/wp-content/themes",如果WordPress安装在你的网络根文件夹中,你将会导航到"public_html/wp-content/themes"。
# Once you've navigated to the themes folder in cPanel File Manager, click on Upload file(s) and upload that zip file you saved in Step 1.
# Once you've navigated to the themes folder in cPanel File Manager, click on Upload file(s) and upload that zip file you saved in Step 1.
#你一旦导航到了cPanel文件管理器中的主题文件夹,点击上传文件,上传你在第一步时,保存的压缩文件。
#Once the zip file is uploaded, click on the zip file name in cPanel, then in the panel to the right, click on Extract File Contents, and that zip file will be uncompressed.
#Once the zip file is uploaded, click on the zip file name in cPanel, then in the panel to the right, click on Extract File Contents, and that zip file will be uncompressed.
#上传好压缩文件之后,点击cPanel中的压缩文件名,然后再在右边的面板上,点击提取文件内容,这个压缩文件就会被解压。
#Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
#Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示说明]],选择新的主题。


===Selecting the Active Theme===
===Selecting the Active Theme===
===选择 Active 主题===
To select the active theme for your site:
To select the active theme for your site:
为你的站点选择active主题:


# Log in to the WordPress [[WordPress:Administration Panels]].
# Log in to the WordPress [[WordPress:Administration Panels]].
#登录到WordPress [[WordPress:Administration Panels|管理面板]]。
# Select the [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]] subpanel.
# Select the [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]] subpanel.
#选择[[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]]子面板。
# From the '''Available Themes''' section, click on theme title (or theme screenshot) for the theme you wish to activate.
# From the '''Available Themes''' section, click on theme title (or theme screenshot) for the theme you wish to activate.
#在'''可获得的主题'''部分,为你希望激活的主题,点击主题标题(或者主题截屏)。
# To view the new look, click '''View Site''' at the top of the Panel's screen.
# To view the new look, click '''View Site''' at the top of the Panel's screen.
#要访问新的外观,请在面板界面的顶上方点击'''访问站点'''。


Your selection should immediately become active.
Your selection should immediately become active.
操作立马就会激活。


==Creating Themes==
==Creating Themes==
==创建主题==


If you are interested in creating your own theme for distribution, or learning more about the architecture of themes, please review the documentation regarding [[WordPress:Theme Development]] and [[WordPress:Designing Themes for Public_Release]].
If you are interested in creating your own theme for distribution, or learning more about the architecture of themes, please review the documentation regarding [[WordPress:Theme Development]] and [[WordPress:Designing Themes for Public_Release]].
如果你对创建发行主题感兴趣,或者你想要学习更多的关于主题结构的内容,请查看关于[[WordPress:Theme Development|主题发展]] 和[[WordPress:Designing Themes for Public_Release| Designing Themes for Public_Release]]方面的文档。


===Theme Files===
===Theme Files===
===主题文件===


The following are the files typically included within a Theme.
The following are the files typically included within a Theme.
下面是主题中通常包含的文件。


*[[WordPress:Creating_an_Error_404_Page|404 Template]] = <tt>404.php</tt>
*[[WordPress:Creating_an_Error_404_Page|404 Template]] = <tt>404.php</tt>
第128行: 第294行:
*[[WordPress:Customizing Your Sidebar|Sidebar Template]] = <tt>sidebar.php</tt>
*[[WordPress:Customizing Your Sidebar|Sidebar Template]] = <tt>sidebar.php</tt>
*Stylesheet = <tt>style.css</tt>
*Stylesheet = <tt>style.css</tt>
*[[WordPress:Creating_an_Error_404_Page|404 模板]] = <tt>404.php</tt>
*归档模板 = <tt>archive.php</tt>
*[[WordPress:Creating_an_Archive_Index|归档索引页]] = <tt>archives.php</tt>
*评论模板 = <tt>comments.php</tt>
*页脚模板 = <tt>footer.php</tt>
*[[WordPress:Designing Headers|标头模板]] = <tt>header.php</tt>
*链接= <tt>links.php</tt>
*主模板 = <tt>index.php</tt>
*[[WordPress:Pages|网页模板]] = <tt>page.php</tt>
*弹出的评论模板 = <tt>comments-popup.php</tt>
*文章模板 = <tt>single.php</tt>
*搜索形式 = <tt>searchform.php</tt>
*[[WordPress:Creating a Search Page|搜索模板]] = <tt>search.php</tt>
*[[WordPress:Customizing Your Sidebar|边栏模板]] = <tt>sidebar.php</tt>
*样式表 = <tt>style.css</tt>


== Moving from 1.2.x to 1.5 == <span id="Moving 1.2.x to 1.5"></span>
== Moving from 1.2.x to 1.5 == <span id="Moving 1.2.x to 1.5"></span>
== 从1.2.x 移到 1.5 == <span id="从 1.2.x 移到 1.5"></span>


For details on upgrading WordPress and your WordPress Theme from v1.2 to 1.5, see: [[WordPress:Upgrade_1.2_to_1.5|Upgrade 1.2 to 1.5]].
For details on upgrading WordPress and your WordPress Theme from v1.2 to 1.5, see: [[WordPress:Upgrade_1.2_to_1.5|Upgrade 1.2 to 1.5]].
关于将WordPress和你的WordPress主题从1.2版本升级到1.5版本的详细信息,请看看:[[WordPress:Upgrade_1.2_to_1.5|从1.2升级到1.5]]。


==Theme Tools and Other Resources==
==Theme Tools and Other Resources==
==主题工具和其它的资源==


These tools and resources will aid you in creating and/or enhancing themes.
These tools and resources will aid you in creating and/or enhancing themes.
这些工具和资源会帮助你,创建和/或者提高主题。


===Layout===
===Layout===
===布局===


* [[WordPress:Blog Design and Layout]]
* [[WordPress:Blog Design and Layout]]
第150行: 第360行:
* [http://www.redalt.com/Tools/builder.php WordPress Index Builder]  
* [http://www.redalt.com/Tools/builder.php WordPress Index Builder]  
* [http://www.wateronlydries.com/?p=158 Photoshop Template for the WordPress Default Theme]
* [http://www.wateronlydries.com/?p=158 Photoshop Template for the WordPress Default Theme]
* [[WordPress:Blog Design and Layout|博客设计和布局]]
* [[WordPress:Stepping Into Templates|走进模板]]
* [[WordPress:Customizing Your Sidebar|自定义你的边栏]]
* [[WordPress:Good Navigation Links|好的导航链接]]
* [[WordPress:Next and Previous Links|上一个和下一个链接]]
* [[WordPress:Styling Lists with CSS|CSS的设计表]]
* [[WordPress:Creating Horizontal Menus|创建横向菜单]]
* [[WordPress:Dynamic Menu Highlighting|动态菜单聚焦]]
* [[WordPress:FAQ Layout and Design|FAQ 布局和设计]]
* [http://www.redalt.com/Tools/builder.php WordPress Index Builder]
* [http://www.wateronlydries.com/?p=158 WordPress 默认主题的Photoshop模板]


===Templates and Template Tags===
===Templates and Template Tags===
===模板和模板标签===


* [[WordPress:Templates|Template Files]]
* [[WordPress:Templates|Template Files]]
第163行: 第390行:
* [http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/ Templates and the is functions]
* [http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/ Templates and the is functions]
* [http://www.urbangiraffe.com/2005/04/12/themeguide1/1/ Dissection of a WordPress Theme]
* [http://www.urbangiraffe.com/2005/04/12/themeguide1/1/ Dissection of a WordPress Theme]
* [[WordPress:Templates|模板文件]]
* [[WordPress:Stepping Into Templates|走进模板]]
* [[WordPress:Stepping Into Template Tags|走进模板标签]]
* [[WordPress:Template Tags|模板标签]]
* [[WordPress:Theme Development|正在发展的 WordPress 主题]]
* [[WordPress:The Loop in Action|运转的Loop]]
* [http://guff.szub.net/wordpress/template-tags/ 便于阅读的模板标签布局]
* [http://boren.nu/archives/2004/11/10/anatomy-of-a-wordpress-theme/ WordPress主题解析]
* [http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/ 模板 and the is functions]
* [http://www.urbangiraffe.com/2005/04/12/themeguide1/1/ 讨论WordPress主题]


===Tools and Resources===
===Tools and Resources===
===工具和资源===


* [[WordPress:Designing Themes for Public Release]]
* [[WordPress:Designing Themes for Public Release]]
第177行: 第430行:
*[http://coevolving.com/blogs/index.php/archive/installing-and-customizing-wordpress-on-your-own-domain/ Coevolving Innovations guide to Installing Wordpress (including a Theme) on a web host with Fantastico and cPanel] (at Wordpress 2.2.1)
*[http://coevolving.com/blogs/index.php/archive/installing-and-customizing-wordpress-on-your-own-domain/ Coevolving Innovations guide to Installing Wordpress (including a Theme) on a web host with Fantastico and cPanel] (at Wordpress 2.2.1)
*[http://wordpress.thelinuxpenguin.com/ Tutorial: How to Install a Wordpress Theme]
*[http://wordpress.thelinuxpenguin.com/ Tutorial: How to Install a Wordpress Theme]
* [[WordPress:Designing Themes for Public Release|为公开发行设计主题]]
* [[WordPress:Know Your Sources|了解你的原始资料]]
* [[WordPress:Validating a Website|确认网站]]
* [[WordPress:Finding Your CSS Styles|找到你的CSS样式]]
* [[WordPress:CSS Fixing Browser Bugs|CSS解决浏览器程序错误]]
* [http://elasticdog.com/2004/11/wp-design-sandbox/ WordPress Design Sandbox Article]
* [http://www.cameraontheroad.com/index.php?p=594 处理CSS 和WordPress主题(使用 sandbox)]
*[http://theundersigned.net/2006/05/from-xhtmlcss-to-wordpress/ 从XHTML CSS到WordPress (创建主题}]
*[http://www.jonathanwold.com/tutorials/wordpress_theme/ 指南: 怎样创建一个WordPress主题]
*[http://coevolving.com/blogs/index.php/archive/installing-and-customizing-wordpress-on-your-own-domain/ Coevolving Innovations guide to Installing Wordpress (包含一个主题) on a web host with Fantastico and cPanel] (在 Wordpress 2.2.1版本)
*[http://wordpress.thelinuxpenguin.com/ 指南:怎样安装Wordpress 主题]


===Colors, Graphics, and Fonts===
===Colors, Graphics, and Fonts===
===颜色,图形,和字体===


* [http://www.redalt.com/Tools/kubrickr.php Kubrickr - Changes Default Theme Header Images]  
* [http://www.redalt.com/Tools/kubrickr.php Kubrickr - Changes Default Theme Header Images]  
第190行: 第459行:
* [http://colr.org Colr.org - For Finding Colors in an Image]
* [http://colr.org Colr.org - For Finding Colors in an Image]
* [http://www.redalt.com/Tools/ilyc.php I Like Your Colors]
* [http://www.redalt.com/Tools/ilyc.php I Like Your Colors]
* [http://www.2yi.net/free-stock-photos.html List of More than 70 Free Stock Photo Sites]
* [http://labs.adobe.com/technologies/kuler/ kuler - Create color palettes with this web app from Adobe Labs]
* [http://www.redalt.com/Tools/kubrickr.php Kubrickr – 更改默认主题标头图像]
* [http://www.digitalwestex.com/gallery/index.php?cat=3 标头图形]
* [http://creativecommons.org/image/ Creative Commons Images]
* [http://www.imageafter.com/ Image * After - Free Stock Image Library]
* [http://www.freeiconsweb.com/ 免费图标库]
* [http://www.sxc.hu/ Stock.xchng - Free Stock Image Library]
* [[WordPress:Playing With Fonts|处理字体]]
* [[WordPress:Developing a Colour Scheme|发展颜色方案]]
* [http://colr.org Colr.org – 查找图像中的颜色]
* [http://www.redalt.com/Tools/ilyc.php 我喜欢你的颜色]
* [http://www.2yi.net/free-stock-photos.html List of More than 70 Free Stock Photo Sites]
* [http://www.2yi.net/free-stock-photos.html List of More than 70 Free Stock Photo Sites]
* [http://labs.adobe.com/technologies/kuler/ kuler - Create color palettes with this web app from Adobe Labs]
* [http://labs.adobe.com/technologies/kuler/ kuler - Create color palettes with this web app from Adobe Labs]

2008年8月20日 (三) 15:15的最新版本


Before the advent of Themes, WordPress generated content using a single file, index.php, and files to support comment display and submission. A single style sheet controlled the presentation. All other pages, including the category and archive pages, were generated by passing parameters to the index.php page.

在主题出现之前,WordPress使用单一的文件index.php创建内容,并且使用文件,递交和显示评论。单一的样式表控制外观。所有其它的网页,包括类别和归档网页,是通过将参数传递到index.php页面,产生的。

The new Theme system provides two convenient features.

新的主题系统提供了两个方便的功能。

Physically Separate Components
The new WordPress modular template files system provides a method to define separate physical PHP files for the different components of your WordPress site. This allows creation of unique designs and functionality for many special pages, such as category archives, monthly archives, and the individual entry pages.

;分开组成部分:新的WordPress模块模板 文件系统提供了一种方法,为WordPress站点的不同部分,定义不同的PHP文件。这样能够为许多特别的网页创建独一的设计和功能,例如类别归档, 按月归档,以及只有一篇文章的网页。

Quickly Change Layout and Design
It allows users with appropriate permissions to quickly change the layout of the entire site by uploading a new theme and essentially flipping a switch in the admin panel.

;快速地更改布局和设计:拥有一定权限的用户,通过上传一个新的主题,按一下管理面板中的按钮,就可以快速地更改整个站点的布局和设计。 The old method of generating pages will still work. If you are upgrading from v1.2 or v1.2.1 or v1.2.2, you can continue using your existing design. Keeping your older design will not prevent you from adding additional themes and easily switching between designs.

创建网页的旧方法仍然适用。如果你从1.2或者1.2.1或者1.2.2版本升级你可以继续使用当前的设计。保持旧的样式,你仍然能够添加主题并且轻易地切换样式。

What is a Theme?[ ]

主题是什么?[ ]

Fundamentally, the WordPress Theme system is a way to "skin" your weblog. Yet, it is more than just a "skin." Skinning your site implies that only the design is changed. WordPress Themes can provide much more control over the look and presentation of the material on your website.

一般来说,WordPress主题系统是"包装"你的博客外观的方式。但是,主题不仅起着"包装"作用。包装你的站点暗示只有设计更改了。WordPress能够更多地控制你的网站上的材料的外观和呈现方式

A WordPress Theme is a collection of files that work together to produce a graphical interface with an underlying unifying design for a weblog. These files are called template files. A theme modifies the way the site is displayed, without modifying the underlying software. Themes may include customized template files, image files (*.jpg, *.gif), style sheets (*.css), custom WordPress:Pages, as well as any necessary code files (*.php). For an introduction to template files, see WordPress:Stepping Into Templates.

WordPress主题指的是一些文件的集合,这些文件一起运行,输出一种图形界面,这个图形界面拥有网页日志的潜在的统一的设计。这些文件称为模板文件。主题可以更改站点的显示方式,但是不会更改潜在的软件。主题可能包含自定义的模板文件,图像文件(*.jpg, *.gif),样式表(*.css),自定义网页,以及任何必要的代码文件(*.php)。关于模板文件的介绍,请看看走进模板。 Themes are a whole new ball game. Let's say you write a lot about cheese and gadgets. Through the innovative use of the WordPress Loop and template files, you can customize your Cheese category posts to look different from your Gadgets category posts. With this powerful control over what different pages and categories look like on your site, you are limited only by your imagination. For information on how to use different Themes for different categories or posts, see WordPress:The Loop in Action and WordPress:Category Templates.

主题是一种全新的情况。假如你写了许多关于奶酪和gadgets的文章。通常创新性地使用WordPress Loop模板文件,你可以自定义你的奶酪类别文章,使得这些文章与你的Gadgets文章看起来不同。能够控制站点上的不同网页和类别的外观之后,你只会受你的想象力的限制了。关于怎样为不同的类别和文章使用不同的主题,请看看运转的Loop类别模板

Get New Themes[ ]

得到新的主题[ ]

The WordPress Theme Viewer is the official site for WordPress Themes which have been checked and inspected, and are free for downloading. The site features the ability to search by type and style, and offers a demonstration of the page view elements of the Theme.

WordPress Theme Viewer是WordPress主题的官方站点,这个站点中的主题得到审查,而且可以免费下载。你可以在这个站点上通过主题的类型和样式搜索主题,而且可以看到主题的网页浏览元素。

Other sources for WordPress Themes may include:

WordPress主题的其它资源,包括:














Using Themes[ ]

使用主题[ ]

WordPress supplies two themes in its distribution for your initial use. You can switch between these two themes using the admin panel. Themes that you add to that directory will appear in the WordPress:Administration Panels > Presentation as additional selections.

你开始使用时,就可以使用WordPress发行的两个主题。你可以使用管理面板,切换使用两个主题。你添加到目录中的主题会出现在管理面板 > Presentation中,作为额外的选项。

Adding New Themes[ ]

添加新的主题[ ]

There are many themes available for download that will work with your WordPress installation.

可以下载许多主题,在WordPress中运行。

thumb|right|Presentation Theme PanelIf the theme that you are installing provides instructions, be sure to read through and follow those instructions for the successful installation of the theme. It is recommended that theme developers provide installation instructions for their own themes, because themes can provide special optional functionality that may require more steps than the basic installation steps covered here. If your theme does not work after following any provided instructions, please contact the theme author for help.

thumb|right|Presentation 主题面板如果你安装的主题提供了指示说明,要确定通读这些说明,并且遵循这些说明,以成功地安装主题。建议主题开发人员,为自己的主题提供安装说明,因为主题提供了特别的可选择的功能,这些功能的安装比基本的安装步骤可能更复杂。如果你遵循了任何的说明之后,你的主题仍然不能够运行,请联系主题作者,寻求帮助

To add a new theme to your WordPress installation, follow these basic steps:

要为你的WordPress添加一个新的主题,请遵循下面的基本步骤:

  1. Download the theme archive and extract the files it contains. You may need to preserve the directory structure in the archive when extracting these files. Follow the guidelines provided by your theme author.
  1. 下载主题归档并且解压这些归档所包含的文件。解压这些文件的时候,你可能需要在归档中保存这些目录结构。遵循主题作者提供的指导。
  1. Using an FTP client to access your host web server, create a directory to contain your theme in the wp-content/themes directory provided by WordPress. For example, a theme named Test should be in wp-content/themes/test. Your theme may provide this directory as part of the archive.
  1. 使用FTP client访问你的主机网络服务器,创建一个目录,将主题包含在WordPress提供的wp-content/themes目录。例如,一个名为测试的主题应该包含在wp-content/themes/test。你的主题应该提供这个目录,作为归档的一部分。
  1. Upload the theme files to the new directory on your host server.
  2. 将主题文件上传到你的主机服务器的新目录中。
  1. Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
  1. 遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示]]选择新的主题。

Adding New Themes in cPanel[ ]

在 cPanel 中添加新的主题[ ]

If your host offers the cPanel control panel, and the theme files are in a .zip or .gz archive follow these instructions. Note: This assumes the theme you download is a compressed (zip) file and the files in the zip file are in their 'named' folder.

如果你的主机提供cPanel控制面板,而且主题文件在.zip 或者 .gz归档中,遵循这些指示说明。注:这个前提是你下载的主题是个压缩文件而且压缩文件中的文件在'指定的'文件夹中。

  1. Download the theme zip file to your local machine.
  2. 将主题压缩文件下载到你的本地电脑上。
  1. In cPanel File Manager, navigate to your themes folder. If you have WordPress installed in it's own folder called wordpress, you would navigate to "public_html/wordpress/wp-content/themes" and if WordPress is installed in your web-root folder you would navigate to "public_html/wp-content/themes".
  1. 在cPanel文件管理器中,导航到当你主题文件夹。如果你将WordPress安装在其自身称为wordpress的文件夹中,你将会导航到"public_html/wordpress/wp-content/themes",如果WordPress安装在你的网络根文件夹中,你将会导航到"public_html/wp-content/themes"。
  1. Once you've navigated to the themes folder in cPanel File Manager, click on Upload file(s) and upload that zip file you saved in Step 1.
  1. 你一旦导航到了cPanel文件管理器中的主题文件夹,点击上传文件,上传你在第一步时,保存的压缩文件。
  1. Once the zip file is uploaded, click on the zip file name in cPanel, then in the panel to the right, click on Extract File Contents, and that zip file will be uncompressed.
  1. 上传好压缩文件之后,点击cPanel中的压缩文件名,然后再在右边的面板上,点击提取文件内容,这个压缩文件就会被解压。
  1. Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.
  1. 遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示说明]],选择新的主题。

Selecting the Active Theme[ ]

选择 Active 主题[ ]

To select the active theme for your site:

为你的站点选择active主题:

  1. Log in to the WordPress WordPress:Administration Panels.
  1. 登录到WordPress 管理面板
  1. Select the Presentation subpanel.
  2. 选择Presentation子面板。
  1. From the Available Themes section, click on theme title (or theme screenshot) for the theme you wish to activate.
  1. 可获得的主题部分,为你希望激活的主题,点击主题标题(或者主题截屏)。
  1. To view the new look, click View Site at the top of the Panel's screen.
  1. 要访问新的外观,请在面板界面的顶上方点击访问站点

Your selection should immediately become active.

操作立马就会激活。

Creating Themes[ ]

创建主题[ ]

If you are interested in creating your own theme for distribution, or learning more about the architecture of themes, please review the documentation regarding WordPress:Theme Development and WordPress:Designing Themes for Public_Release.

如果你对创建发行主题感兴趣,或者你想要学习更多的关于主题结构的内容,请查看关于主题发展 Designing Themes for Public_Release方面的文档。

Theme Files[ ]

主题文件[ ]

The following are the files typically included within a Theme.

下面是主题中通常包含的文件。









  • 404 模板 = 404.php
  • 归档模板 = archive.php
  • 归档索引页 = archives.php
  • 评论模板 = comments.php
  • 页脚模板 = footer.php
  • 标头模板 = header.php
  • 链接= links.php
  • 主模板 = index.php
  • 网页模板 = page.php
  • 弹出的评论模板 = comments-popup.php
  • 文章模板 = single.php
  • 搜索形式 = searchform.php
  • 搜索模板 = search.php
  • 边栏模板 = sidebar.php
  • 样式表 = style.css



== Moving from 1.2.x to 1.5 ==

== 从1.2.x 移到 1.5 ==

For details on upgrading WordPress and your WordPress Theme from v1.2 to 1.5, see: Upgrade 1.2 to 1.5.

关于将WordPress和你的WordPress主题从1.2版本升级到1.5版本的详细信息,请看看:从1.2升级到1.5

Theme Tools and Other Resources[ ]

主题工具和其它的资源[ ]

These tools and resources will aid you in creating and/or enhancing themes.

这些工具和资源会帮助你,创建和/或者提高主题。

Layout[ ]

布局[ ]



Templates and Template Tags[ ]

模板和模板标签[ ]








Tools and Resources[ ]

工具和资源[ ]


Colors, Graphics, and Fonts[ ]

颜色,图形,和字体[ ]