WordPress: Design Themes SubPanel:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
第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.


在主题出现之前,WordPress使用单一的文件<tt>index.php</tt>创建内容,并且使用文件,支持评论的递交和显示。单一的样式表控制外观。所有其它的网页,包括类别和归档网页,是通过将参数传递到<tt>index.php</tt>页面,产生的。
在主题出现之前,WordPress使用单一的文件<tt>index.php</tt>创建内容,并且使用文件,支持评论的递交和显示。单一的样式表控制外观。所有其它的网页,包括类别和归档网页,是通过将参数传递到<tt>index.php</tt>页面,产生的。
 
   
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.
;分开评论:新的WordPress模块[[WordPress:Stepping Into Templates|模板 文件]]系统提供了一种方法,为WordPress站点的不同部分,定义不同的[[WordPress:Glossary#PHP|PHP]]文件。这样能够为许多特别的网页创建独一的设计和功能,例如[[WordPress:Category Templates|类别归档]], [[WordPress:Creating_an_Archive_Index|按月归档]],以及只有一篇文章的网页。
 
;分开评论:新的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.
 
;快速地更改布局和设计:拥有一定权限的用户,通过上传一个新的主题,按一下管理面板中的按钮,就可以快速地更改整个站点的布局和设计。


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版本升级]],'''你可以继续使用当前的设计'''。保持旧的样式,你仍然能够添加主题并且轻易地切换样式。
创建网页的旧方法仍然适用。如果你从[[WordPress:Upgrade_1.2_to_1.5|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能够更多地控制你的网站上的材料的外观''和呈现方式''。
一般来说,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]].


WordPress主题指的是一些文件的集合,这些文件一起运行,输出一种图形界面,这个图形界面拥有网页日志的潜在的统一的设计。这些文件称为[[WordPress:Templates|'''模板文件''']]。主题可以更改站点的显示方式,但是不会更改潜在的软件。主题可能包含自定义的模板文件,图像文件(<tt>*.jpg</tt>, <tt>*.gif</tt>),样式表(<tt>*.css</tt>),自定义[[WordPress:Pages|网页]],以及任何必要的代码文件(<tt>*.php</tt>)。关于模板文件的介绍,请看看[[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]].


主题是一种全新的情况。加入你写了许多关于奶酪和gadgets的文章。通常创新性地使用[[WordPress:The Loop|WordPress Loop]] 和[[WordPress:Templates|模板文件]],你可以自定义你的奶酪类别文章,使得这些文章与你的Gadgets文章看起来不同。能够控制站点上的不同网页和类别的外观之后,你只会受你的想象力的限制了。关于怎样为不同的类别和文章使用不同的主题,请看看[[WordPress:The Loop in Action|运转的Loop]] 和[[WordPress:Category Templates|类别模板]]。
主题是一种全新的情况。加入你写了许多关于奶酪和gadgets的文章。通常创新性地使用[[WordPress:The Loop|WordPress Loop]] 和[[WordPress:Templates|模板文件]],你可以自定义你的奶酪类别文章,使得这些文章与你的Gadgets文章看起来不同。能够控制站点上的不同网页和类别的外观之后,你只会受你的想象力的限制了。关于怎样为不同的类别和文章使用不同的主题,请看看[[WordPress:The Loop in Action|运转的Loop]] 和[[WordPress:Category Templates|类别模板]]。
==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.


[http://themes.wordpress.net/ WordPress Theme Viewer]是WordPress主题的官方站点,这个站点中的主题得到审查,而且可以免费下载。你可以在这个站点上通常主题的类型和样式搜索主题,而且可以看到主题的网页浏览元素。
[http://themes.wordpress.net/ WordPress Theme Viewer]是WordPress主题的官方站点,这个站点中的主题得到审查,而且可以免费下载。你可以在这个站点上通常主题的类型和样式搜索主题,而且可以看到主题的网页浏览元素。
There are many other online sources for WordPress Themes you can find in your favorite search engine. Please test WordPress Themes and check them thoroughly for unwanted links, scripts, and code before using on your blog to ensure your blog's safety.


你可以在你最喜爱的搜索引擎中找到WordPress主题的许多其它在线资源。请测试WordPress主题,并且彻底地审查不必要的链接,脚本,以及代码,再将主题使用到你的博客上,以确保安全。
你可以在你最喜爱的搜索引擎中找到WordPress主题的许多其它在线资源。请测试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]] > [[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]]中,作为额外的选项。
你开始使用时,就可以使用两个WordPress发行的主题。你可以使用管理面板,切换使用两个主题。你添加到目录中的主题会出现在[[WordPress:Administration Panels|管理面板]] > [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|Presentation]]中,作为额外的选项。
===Adding New Themes===


===添加新的主题===
===添加新的主题===
There are many themes available for download that will work with your WordPress installation.


可以下载许多主题,与WordPress一起运行。
可以下载许多主题,与WordPress一起运行。
[[WordPress:Image:themes.png|thumb|right|Design Themes SubPanel]]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:themes.png|thumb|right|设计主题子面板]]如果你安装的主题提供了指示说明,要确定通读这些说明,并且遵循这些说明,以成功地安装主题。'''建议主题开发人员,为自己的主题提供安装说明''',因为主题提供了特别的可选择的功能,这些功能比基本的安装步骤可能更复杂。如果你遵循了任何的说明之后,你的主题仍然不能够运行,请'''联系主题作者,寻求帮助'''。
[[WordPress:Image:themes.png|thumb|right|设计主题子面板]]如果你安装的主题提供了指示说明,要确定通读这些说明,并且遵循这些说明,以成功地安装主题。'''建议主题开发人员,为自己的主题提供安装说明''',因为主题提供了特别的可选择的功能,这些功能比基本的安装步骤可能更复杂。如果你遵循了任何的说明之后,你的主题仍然不能够运行,请'''联系主题作者,寻求帮助'''。
To add a new theme to your WordPress installation, follow these basic steps:


要为你的WordPress添加一个新的主题,请遵循下面的基本步骤:
要为你的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.
#下载主题归档并且解压这些归档所包含的文件。解压这些文件的时候,你可能需要在归档中保存这些目录结构。遵循主题作者提供的指导。
#下载主题归档并且解压这些归档所包含的文件。解压这些文件的时候,你可能需要在归档中保存这些目录结构。遵循主题作者提供的指导。
# 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>。你的主题应该提供这个目录,作为归档的一部分。
#使用[[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.


#将主题文件上传到你的主机服务器的新目录中。
#将主题文件上传到你的主机服务器的新目录中。
# Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.


#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示]]选择新的主题。
#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示]]选择新的主题。


====Adding a New Theme Tutorial====
====添加一个新的主题指南====
====添加一个新的主题指南====
[http://www.village-idiot.org/archives/2008/06/13/how-to-upload-a-wordpress-theme/ How to upload a WordPress theme] is a useful tutorial on how easy it is to install a theme.


[http://www.village-idiot.org/archives/2008/06/13/how-to-upload-a-wordpress-theme/ 怎样上传一个WordPress主题]是个非常有用的指南,关于安装一个主题有多么简单。
[http://www.village-idiot.org/archives/2008/06/13/how-to-upload-a-wordpress-theme/ 怎样上传一个WordPress主题]是个非常有用的指南,关于安装一个主题有多么简单。
====Adding New Themes in cPanel ====


====在 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.


如果你的主机提供[[WordPress:Glossary#cPanel|cPanel]]控制面板,而且主题文件在.zip 或者 .gz归档中,遵循这些指示说明。注:这个前提是你下载的主题是个压缩文件而且压缩文件中的文件在'指定的'文件夹中。
如果你的主机提供[[WordPress:Glossary#cPanel|cPanel]]控制面板,而且主题文件在.zip 或者 .gz归档中,遵循这些指示说明。注:这个前提是你下载的主题是个压缩文件而且压缩文件中的文件在'指定的'文件夹中。
# 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".


#在cPanel文件管理器中,导航到当你主题文件夹。如果你将WordPress安装在其自身称为wordpress的文件夹中,你将会导航到"public_html/wordpress/wp-content/themes",如果WordPress安装在你的网络根文件夹中,你将会导航到"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.


#你一旦导航到了cPanel文件管理器中的主题文件夹,点击上传文件,上传你在第一步时,保存的压缩文件。
#你一旦导航到了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.


#上传好压缩文件之后,点击cPanel中的压缩文件名,然后再在右边的面板上,点击提取文件内容,这个压缩文件就会被解压。
#上传好压缩文件之后,点击cPanel中的压缩文件名,然后再在右边的面板上,点击提取文件内容,这个压缩文件就会被解压。
#Follow the [[WordPress:#Selecting_the_Active_Theme|instructions below]] for selecting the new theme.


#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示说明]],然而再选择新的主题。
#遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示说明]],然而再选择新的主题。


===Selecting the Active Theme===
===选择 Active 主题===
===选择 Active 主题===
To select the active theme for your site:


为你的站点选择active主题:
为你的站点选择active主题:


# Log in to the WordPress [[WordPress:Administration Panels]].
#登录到WordPress [[WordPress:Administration Panels|管理面板]]。  
 
#登录到WordPress [[WordPress:Administration Panels|管理面板]]。
 
# Click the [[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|Design]] panel menu tab. By default you will be in the [[WordPress:Administration_Panels#Themes |Themes]] subpanel.


#点击[[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|设计]]面板菜单标签。默认情况下,你会在[[WordPress:Administration_Panels#Themes |主题]]子面板。
#点击[[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|设计]]面板菜单标签。默认情况下,你会在[[WordPress:Administration_Panels#Themes |主题]]子面板。
# 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.


#要访问新的外观,请在面板界面的顶上方点击'''访问站点'''。
#要访问新的外观,请在面板界面的顶上方点击'''访问站点'''。
Your selection should immediately become active.


选项立马就会激活。
选项立马就会激活。
===Editing a Theme===


===编辑主题===
===编辑主题===


To edit an uploaded theme's files:
编辑上传的主题文件:
编辑上传的主题文件:
# Log in to the WordPress [[WordPress:Administration Panels]].


#登录到WordPress的[[WordPress:Administration Panels|管理面板]]。
#登录到WordPress的[[WordPress:Administration Panels|管理面板]]。
# Click the [[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|Design]] panel menu tab.


#点击[[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|设计]]面板菜单标签。
#点击[[WordPress:Administration_Panels#Design_-_Change_the_Look_of_your_Blog|设计]]面板菜单标签。
# Click the [[WordPress:Administration_Panels#Theme_Editor|Theme Editor]] subpanel menu tab.


#点击[[WordPress:Administration_Panels#Theme_Editor|主题编辑器]]子面板菜单标签。
#点击[[WordPress:Administration_Panels#Theme_Editor|主题编辑器]]子面板菜单标签。
# By default, the [[WordPress:Administration_Panels#Theme_Editor|Theme Editor]] subpanel loads the files for the currently active theme. If you would like to edit a different theme, select it from the "Select theme to edit" dropdown and click "Select."


#默认情况下,[[WordPress:Administration_Panels#Theme_Editor|主题编辑器]]为当前激活的主题载入文件。如果你想要编辑一个不同的主题,在"选择要编辑的主题"下拉列表上选择要编辑的主题,并且点击"选择。"
#默认情况下,[[WordPress:Administration_Panels#Theme_Editor|主题编辑器]]为当前激活的主题载入文件。如果你想要编辑一个不同的主题,在"选择要编辑的主题"下拉列表上选择要编辑的主题,并且点击"选择。"
# Click the name of the file you would like to edit from the list on the right.


#从右边的列表上选择你想要编辑的文件名。
#从右边的列表上选择你想要编辑的文件名。
# Make desired changes in the text box and click "Update File."


#在文本框中更改好,并且点击"更新文件。"
#在文本框中更改好,并且点击"更新文件。"
If you don't already have a backup copy of your theme handy, it may be a good idea to [[WordPress:WordPress_Backups#Backing_Up_Your_WordPress_Site|backup your theme files]] before you proceed with editing it.


如果你手边没有你的主题的备份,先[[WordPress:WordPress_Backups#Backing_Up_Your_WordPress_Site|备份你的主题文件]],在编辑这个文件,会是个好办法。
如果你手边没有你的主题的备份,先[[WordPress:WordPress_Backups#Backing_Up_Your_WordPress_Site|备份你的主题文件]],在编辑这个文件,会是个好办法。
==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]].


如果你对自己创建主题,发行,感兴趣,或者你想要学习更多的关于主题结构的内容,请查看关于[[WordPress:Theme Development|主题发展]] 和[[WordPress:Designing Themes for Public Release|为公开发行设计主题]]方面的文档。
如果你对自己创建主题,发行,感兴趣,或者你想要学习更多的关于主题结构的内容,请查看关于[[WordPress:Theme Development|主题发展]] 和[[WordPress:Designing Themes for Public Release|为公开发行设计主题]]方面的文档。
===Theme Files===


===主题文件===
===主题文件===
The following are the files typically included within a Theme.


下面是主题中通常包含的文件。
下面是主题中通常包含的文件。
*[[WordPress:Creating_an_Error_404_Page|404 Template]] = <tt>404.php</tt>
*Archive Template = <tt>archive.php</tt>
*[[WordPress:Creating_an_Archive_Index|Archive Index Page]] = <tt>archives.php</tt>
*Comments Template = <tt>comments.php</tt>
*Footer Template = <tt>footer.php</tt>
*[[WordPress:Designing Headers|Header Template]] = <tt>header.php</tt>
*Links = <tt>links.php</tt>
*Main Template = <tt>index.php</tt>
*[[WordPress:Pages|Page Template]] = <tt>page.php</tt>
*Popup Comments Template = <tt>comments-popup.php</tt>
*Post Template = <tt>single.php</tt>
*Search Form = <tt>searchform.php</tt>
*[[WordPress:Creating a Search Page|Search Template]] = <tt>search.php</tt>
*[[WordPress:Customizing Your Sidebar|Sidebar Template]] = <tt>sidebar.php</tt>
*Stylesheet = <tt>style.css</tt>
== Moving from 1.2.x to 1.5 == <span id="Moving 1.2.x to 1.5"></span>
*[[WordPress:Creating_an_Error_404_Page|404 模板]] = <tt>404.php</tt>
*[[WordPress:Creating_an_Error_404_Page|404 模板]] = <tt>404.php</tt>
*归档模板 = <tt>archive.php</tt>
*归档模板 = <tt>archive.php</tt>
第240行: 第118行:


== 从1.2.x 移到 1.5 == <span id="从 1.2.x 移到 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]].


关于将WordPress和你的WordPress主题从1.2版本升级到1.5版本的详细信息,请看看:[[WordPress:Upgrade_1.2_to_1.5|从1.2升级到1.5]]。
关于将WordPress和你的WordPress主题从1.2版本升级到1.5版本的详细信息,请看看:[[WordPress:Upgrade_1.2_to_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===


===布局===
===布局===
* [[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]]
* [[WordPress:Creating Horizontal Menus]]
* [[WordPress:Dynamic Menu Highlighting]]
* [[WordPress:FAQ Layout and Design|FAQ Layout and Design]]
* [http://www.redalt.com/Tools/builder.php WordPress Index Builder]
* [http://www.wateronlydries.com/?p=158 Photoshop Template for the WordPress Default Theme]
* [[WordPress:Blog Design and Layout|博客设计和布局]]
* [[WordPress:Blog Design and Layout|博客设计和布局]]
* [[WordPress:Stepping Into Templates|走进模板]]
* [[WordPress:Stepping Into Templates|走进模板]]
第283行: 第137行:
* [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 WordPress 默认主题的Photoshop模板]
* [http://www.wateronlydries.com/?p=158 WordPress 默认主题的Photoshop模板]
===Templates and Template Tags===


===模板和模板标签===
===模板和模板标签===
* [[WordPress:Templates|Template Files]]
* [[WordPress:Stepping Into Templates]]
* [[WordPress:Stepping Into Template Tags]]
* [[WordPress:Template Tags]]
* [[WordPress:Theme Development|Developing WordPress Themes]]
* [[WordPress:The Loop in Action]]
* [http://guff.szub.net/wordpress/template-tags/ Template Tag Layout in simple to read form]
* [http://boren.nu/archives/2004/11/10/anatomy-of-a-wordpress-theme/ Anatomy of a WordPress Theme]
* [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]
* [[WordPress:Templates|模板文件]]
* [[WordPress:Templates|模板文件]]
* [[WordPress:Stepping Into Templates|走进模板]]
* [[WordPress:Stepping Into Templates|走进模板]]
第323行: 第149行:
* [http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/ 模板 and the is functions]
* [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主题]
* [http://www.urbangiraffe.com/2005/04/12/themeguide1/1/ 讨论WordPress主题]
===Tools and Resources===


===工具和资源===
===工具和资源===
* [[WordPress:Designing Themes for Public Release]]
* [[WordPress:Know Your Sources]]
* [[WordPress:Validating a Website]]
* [[WordPress:Finding Your CSS Styles]]
* [[WordPress:CSS Fixing Browser Bugs]]
* [http://elasticdog.com/2004/11/wp-design-sandbox/ WordPress Design Sandbox Article]
* [http://www.cameraontheroad.com/index.php?p=594 Working On CSS and the WordPress Theme (using a sandbox)]
*[http://theundersigned.net/2006/05/from-xhtmlcss-to-wordpress/ From XHTML CSS to WordPress (making a Theme}]
*[http://www.jonathanwold.com/tutorials/wordpress_theme/ Tutorial: How to Create a Wordpress Theme]
*[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://www.danielesalamina.it/screencast-come-modificare-il-proprio-tema-wordpress-in-5-minuti-con-firebug Screencast: Hack a Theme in 5 minute with Firebug]
* [[WordPress:Designing Themes for Public Release|为公开发行设计主题]]
* [[WordPress:Designing Themes for Public Release|为公开发行设计主题]]
* [[WordPress:Know Your Sources|了解你的原始资料]]
* [[WordPress:Know Your Sources|了解你的原始资料]]
第376行: 第163行:
*[http://www.danielesalamina.it/screencast-come-modificare-il-proprio-tema-wordpress-in-5-minuti-con-firebug Screencast: Hack a Theme in 5 minute with Firebug]
*[http://www.danielesalamina.it/screencast-come-modificare-il-proprio-tema-wordpress-in-5-minuti-con-firebug Screencast: Hack a Theme in 5 minute with Firebug]


===Colors, Graphics, and Fonts===
===颜色,图形,和字体===
===颜色,图形,和字体===
* [http://www.redalt.com/Tools/kubrickr.php Kubrickr - Changes Default Theme Header Images]
* [http://www.digitalwestex.com/gallery/index.php?cat=3 Header Graphics]
* [http://creativecommons.org/image/ Creative Commons Images]
* [http://www.imageafter.com/ Image * After - Free Stock Image Library]
* [http://www.freeiconsweb.com/ Free Icons Library]
* [http://www.sxc.hu/ Stock.xchng - Free Stock Image Library]
* [[WordPress:Playing With Fonts]]
* [[WordPress:Developing a Colour Scheme]]
* [http://colr.org Colr.org - For Finding Colors in an Image]
* [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.freeiconsdownload.com/ More Than 230 High Quality Royalty Free Icons Set]
* [http://www.redalt.com/Tools/kubrickr.php Kubrickr – 更改默认主题标头图像]  
* [http://www.redalt.com/Tools/kubrickr.php Kubrickr – 更改默认主题标头图像]  
* [http://www.digitalwestex.com/gallery/index.php?cat=3 标头图形]
* [http://www.digitalwestex.com/gallery/index.php?cat=3 标头图形]

2008年8月25日 (一) 16:10的版本

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

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

分开评论:新的WordPress模块模板 文件系统提供了一种方法,为WordPress站点的不同部分,定义不同的PHP文件。这样能够为许多特别的网页创建独一的设计和功能,例如类别归档, 按月归档,以及只有一篇文章的网页。
快速地更改布局和设计:拥有一定权限的用户,通过上传一个新的主题,按一下管理面板中的按钮,就可以快速地更改整个站点的布局和设计。

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

主题是什么?

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

WordPress主题指的是一些文件的集合,这些文件一起运行,输出一种图形界面,这个图形界面拥有网页日志的潜在的统一的设计。这些文件称为模板文件。主题可以更改站点的显示方式,但是不会更改潜在的软件。主题可能包含自定义的模板文件,图像文件(*.jpg, *.gif),样式表(*.css),自定义网页,以及任何必要的代码文件(*.php)。关于模板文件的介绍,请看看走进模板

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

得到新的主题

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

你可以在你最喜爱的搜索引擎中找到WordPress主题的许多其它在线资源。请测试WordPress主题,并且彻底地审查不必要的链接,脚本,以及代码,再将主题使用到你的博客上,以确保安全。

使用主题

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

添加新的主题

可以下载许多主题,与WordPress一起运行。

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

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

  1. 下载主题归档并且解压这些归档所包含的文件。解压这些文件的时候,你可能需要在归档中保存这些目录结构。遵循主题作者提供的指导。
  1. 使用FTP client访问你的主机网络服务器,创建一个目录,将主题包含在WordPress提供的wp-content/themes目录。例如,一个名为测试的主题应该包含在wp-content/themes/test。你的主题应该提供这个目录,作为归档的一部分。
  1. 将主题文件上传到你的主机服务器的新目录中。
  1. 遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示]]选择新的主题。

添加一个新的主题指南

怎样上传一个WordPress主题是个非常有用的指南,关于安装一个主题有多么简单。

在 cPanel 中添加新的主题

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

  1. 将主题压缩文件下载到你的本地电脑上。
  1. 在cPanel文件管理器中,导航到当你主题文件夹。如果你将WordPress安装在其自身称为wordpress的文件夹中,你将会导航到"public_html/wordpress/wp-content/themes",如果WordPress安装在你的网络根文件夹中,你将会导航到"public_html/wp-content/themes"。
  1. 你一旦导航到了cPanel文件管理器中的主题文件夹,点击上传文件,上传你在第一步时,保存的压缩文件。
  1. 上传好压缩文件之后,点击cPanel中的压缩文件名,然后再在右边的面板上,点击提取文件内容,这个压缩文件就会被解压。
  1. 遵循[[WordPress:#Selecting_the_Active_Theme|下面的指示说明]],然而再选择新的主题。

选择 Active 主题

为你的站点选择active主题:

  1. 登录到WordPress 管理面板
  1. 点击设计面板菜单标签。默认情况下,你会在主题子面板。
  1. 可获得的主题部分,为你希望激活的主题,点击主题标题(或者主题截屏)
  1. 要访问新的外观,请在面板界面的顶上方点击访问站点

选项立马就会激活。

编辑主题

编辑上传的主题文件:

  1. 登录到WordPress的管理面板
  1. 点击设计面板菜单标签。
  1. 点击主题编辑器子面板菜单标签。
  1. 默认情况下,主题编辑器为当前激活的主题载入文件。如果你想要编辑一个不同的主题,在"选择要编辑的主题"下拉列表上选择要编辑的主题,并且点击"选择。"
  1. 从右边的列表上选择你想要编辑的文件名。
  1. 在文本框中更改好,并且点击"更新文件。"

如果你手边没有你的主题的备份,先备份你的主题文件,在编辑这个文件,会是个好办法。

创建主题

如果你对自己创建主题,发行,感兴趣,或者你想要学习更多的关于主题结构的内容,请查看关于主题发展为公开发行设计主题方面的文档。

主题文件

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

  • 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

== 从1.2.x 移到 1.5 ==

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

主题工具和其它的资源

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

布局

模板和模板标签

工具和资源

颜色,图形,和字体