WordPress theme tutorial #3: Start index. php

Source: Internet
Author: User
Tags blank page install wordpress wordpress login wordpress login page

Start index. phpThis is the third tutorial in the WordPress topic series from scratch. After introducing some rules and terms of the WordPress theme, as well as understanding the WordPress template and template file, it is time to start creating the WordPress theme.

In this article, you are about to start writing WordPressCode. We recommend that you install Wordpress on your local computer instead of the server, because it is easier to test locally.

Step 2: Open the XAMPP control panel.

In the XAMPP folder (usually:C: \ XAMPP), Double-clickXampp-control.exeA new window is displayed. Click the start button of Apache and MySQL. As shown in:

After startup, you can see the minimized window.

Step 2: Create a topic folder.

Go to the WordPress theme folder that you installed locally.XAMPP/htdocs/WordPress/WP-content/themes. Create a new folder namedTutorial.

Step 2: Create Index. php And Style.css File.

Open notepad or your selected text editor and copy all the content in index.txt to your notepad. SaveIndex. php.

Open another notepad and save itStyle.cssTo the same folder.

Now there are two files:Index. phpAndStyle.css.

Index. php explanation:

Click the image above to view the large image. I will explain to you what each Red Circle area means.

Doctype-Specify the type of code you use to encode your topic. You don't have to worry about the details here.

<HTML>Is where the web page starts.

<Head>It is the place where your webpage header starts. Each webpage has a header and a subject.</Head>Is the end Of the header.

<? PHP bloginfo ('stylesheet _ url');?>Is a PHP function that can obtainStyle.cssFile path, so that the topic can be usedStyle.cssAll elements on the style page. PHP code is<? PHPAnd?>. PHP code is different from HTML code. In PHP,<? PHPIndicates starting PHP code.?>Is to end the PHP code.

Therefore:

    • <? PHP-Start PHP code
    • Bloginfo ('stylesheet _ url ')-Call the path of the style.css File
    • ;-Stop calling a function. A semicolon is used to end a PHP statement.
    • ?>-End PHP code

<Body>-This is where the webpage subject starts. What you can see and read on the webpage is the main part. The tutorial you are reading shows that you are reading the main part of the current webpage.</Body>The end of the webpage subject.

</Html>It is the end of the web page, and there is nothing behind it.

Step 2: Create style.css.

Copy all the code in style.txt to yourStyle.cssFile. Save and close it.

Step 2: Install your theme.

Open your browser. Enter http: // localhost/WordPress/wp-login.php in the address bar. Log on to your WordPress management background. (Here we can see that the WordPress login page is because you started XAMPP in step 1. Otherwise, your browser will report an error that cannot be found here .)

Go to the Management pageAppearance (apperance)Menu nameTutorial.

Note that your theme file has no screen thumbnails, so it is blank. Once activated, WordPress will tell you the activation information.

Open a new browser or tab (If your browser supports tab browsing) and enterHttp: // localhost/WordPress. You should get a blank page. If not, you are on the wrong page.

Your topic has been created. This is the course. Next we will discuss the topic header template.

Do not forget to disable XAMPP. Double-click the icon in the taskbar, click the stop button of Apache and MySQL, and then click release.

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.