WordPress practice: Customize theme (01)

Source: Internet
Author: User
Tags php basics php windows netbeans

Custom theme requires a certain degree of HTML, CSS, JS, and PHP basics. If you do not have one, go and learn. Http://www.w3schools.com/is an error-free learning place.

Php development tools

To do well, you must first sharpen your tools. At present, there are many editors that can be used to develop PHP, or even notepad, but this is not very efficient. I chose netbeans here. This IDE can provide me with features such as highlight and prompt only. The most important thing is that it is free. : Http://dlc.sun.com.edgesuite.net/netbeans/7.3/final/bundles/netbeans-7.3-windows.exe

In Windows, we also need to configure the PHP host.Program. As A. Net programmer, there is no doubt about using IIS. On the Function management interface of windows, enable IIS functions:

Then download the PHP Windows installation program. Visit http://www.php.net/to find the desired version and install IIS FastCGI to run the PHP program in IIS.

The MySQL database is also a standard configuration. Download it from the official website: http://www.mysql.com/downloads/. download MySQL Community Server and MySQL workbench (GUI tool). The first is the MySQL database program, and the last is the visual management interface.

Create theme

Theme is a sub-directory under WordPress/WP-admin/WP-content/theme. during runtime, WordPress loads theme as a theme.

Create a thinksimple directory.

Themeshould include at least two files: index.php and style.css. Index.php is the first page template, and style.css is the theme style file, which is used to declare the theme details. Add the following at the beginning of the fileCode:

 
/* Theme name: Think simpletheme URI: http://youring2.cnblogs.comDescription: Think simpleversion: 0.1 Author: qeefeeauthor URI: http://youring2.cnblogs.comTags: simple */

This style.css is not automatically added to the index. php file. We need to add reference code to the index. php file:

<LinkREL= "Stylesheet"Type= "Text/CSS"Media= "All"Href= "<? PHP bloginfo ('stylesheet _ url');?> " />

The above Code directly introduces style files. What should I do if I want to reference images or JS files?

At this time, we need to know the template URL, and then match our relative path to get the corresponding image and JS reference. Method to obtain the template directory URL:

 
<?PHP bloginfo ('template _ url ');?>

At this time, the WordPress management interface will be able to see the theme Information We just added.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.