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. php
Is composed of four template files:Header. php
,Index. php
,Sidebar. php
AndFooter. 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. php
Same as template files,Footer. php
Usually, the page does not change. You can place anything here, but it is usuallyCopyright information.
Now let me explain whyIndex. php
The 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. php
And footer.