Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

vi:Sử Dụng Giao Diện

Bản Nháp

Trang này được đánh dấu là bản nháp. Bạn có thể giúp đỡ WordPressVN bằng cách hoàn thiện trang này.

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.

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

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.

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 Pages, as well as any necessary code files (*.php). For an introduction to template files, see 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 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 The Loop in Action and Category Templates.

Get New Themes

The WordPress Theme Directory 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.

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 Administration Panels > Design > Themes as additional selections.

Adding New Themes

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

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.

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

  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.
  2. 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.
  3. Upload the theme files to the new directory on your host server.
  4. Follow the instructions below for selecting the new theme.

Adding New Themes in 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.

  1. Download the theme zip file to your local machine.
  2. 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".
  3. 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.
  4. 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.
  5. Follow the instructions below for selecting the new theme.

Note: You can also install and activate the plugin Get_Theme, to download themes directly to your blog.

Selecting the Active Theme

To select the active theme for your site:

  1. Log in to the WordPress Administration Panels.
  2. Select the Design subpanel, then Themes.
  3. From the Available Themes section, click on theme title (or theme screenshot) for the theme you wish to activate.
  4. A preview of the theme will be shown to activate theme click the Activate "Theme Name" link in the top right.

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 Theme Development and Designing Themes for Public_Release.

Theme Files

The following are the files typically included within a Theme.

== Moving from 1.2.x to 1.5 ==

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

Theme Tools and Other Resources

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


Templates and Template Tags

Tools and Resources

Colors, Graphics, and Fonts