WordPress theme tutorial #2: template files and templates

Source: Internet
Author: User
Tags wordpress blog

Template File(Template files) AndTemplate(Template) Is the second tutorial in the WordPress topic series from scratch. Before you start, make sure you have read the WordPress theme tutorial #1: Introduction. Otherwise, you will not be able to understand the terms used in tutorial #2.
In the WordPress theme tutorial #1: Introduction, we have learned two basic rules and terminologies of WordPress, and this article will explain in depth the template file, template, and the structure of each page.

Wordpress blogEach pageYesComposed of multiple template filesThe following is an example of the Home Page:

In, we can see the topic'sIndex. phpIs composed of four template files:Header. php,Index. php,Sidebar. phpAndFooter. php.

Header template file:

This file usually containsTitle(Title) andDescription(Description ). And they are usually the same throughout the blog.

Index template file:

This template file contains yourLog title,Log Content(That is, the text and images of each log) andLogsOfMetadata(Metadata is the additional information of each log, such as the author, the log release time, the category, and the number of messages ).

Sidebar Template File

This template file is mainly used to control the blogPage List,CATEGORY list,Archive list,Link ListAndOther lists.

Footer template file:

ImageHeader. phpSame as template files,Footer. phpUsually, the page does not change. You can place anything here, but it is usuallyCopyright information.

Now let me explain whyIndex. phpThe area marked in red. The citation area changes based on different types of pages.

If you are on a single log page, the page will contain the four template files:Header. php,Single. php,Sidebar. phpAnd footer.

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.