Home  >  Article  >  CMS Tutorial  >  The whole process of WordPress theme production (11): making page.php

The whole process of WordPress theme production (11): making page.php

藏色散人
藏色散人forward
2023-02-21 10:16:211362browse

I introduced you to "The whole process of WordPress theme production (10): Making comments.php". This article continues to introduce to you how to make page.php. Let's take a look together~

The whole process of WordPress theme production (11): making page.php

page.php is also a page. Maybe you don’t understand what a page means. Aren’t all web pages on a blog a page? The page we are referring to here is a separate page, such as "About", "Contact Information", etc., which can be added and modified in the WordPress backend - Page.

There are many things in this page.php that are similar to single.php, or basically the same. We don’t do too much analysis on some of the content here, and just go to the results. If you don’t understand anything, You can read the whole process of WordPress theme production (8): Creating index.php.

1. Add title

Search code: 797ab9599f8ab2c6d7eb554bd27d2d4c

Change to:


2. Add page content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vel porta erat. Quisque sit amet risus at odio pellentesque sollicitudin. Proin suscipit molestie facilisis. Aenean vel massa magna. Proin nec lacinia augue. Mauris venenatis libero nec odio viverra consequat. In hac habitasse platea dictumst.

Change to:

3. Add a comment box

Change the space between 09fb7e9e235ab3d61d399b9bb6188c66 and f5a47148e367a6035fd7a2faa965022e Delete all code (including f5a47148e367a6035fd7a2faa965022e)

and replace it with:

4. Add query statement

Search code: 797ab9599f8ab2c6d7eb554bd27d2d4c

Change to:


Search:

Change to:

The page you wanted was not found!

Our page.php is finished. There are also two pages, the sidebar page full_width.php and the contact page contact.php. The production methods are exactly the same, so I won’t go into details here. I have already written them directly and you can download them. You may ask, how to use these two pages? I wrote two notes in front of these two pages respectively:


When you create a new page in the WordPress backend in the future, you can select the page template in the right column. You can select Page without sidebar or contract. Leave it unchecked. The page.php template is used by default! You can just change the content of the contact information in the sidebar of contact.php.

So far, our series of tutorials on WordPress theme production has come to an end. To be honest, you probably didn’t learn anything. What I taught was really bad. Just treat it as a perceptual understanding process of WordPress theme production. Bar. Finally, we provide the download of the theme we have created. It is estimated that no one will be willing to use such a theme, it is too ugly! Also, there is no paging function for comments.

Recommended learning: "WordPress Tutorial"

The above is the detailed content of The whole process of WordPress theme production (11): making page.php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:ludou.org. If there is any infringement, please contact admin@php.cn delete
Previous article:The whole process of WordPress theme creation (10): making comments.phpNext article:The whole process of WordPress theme creation (10): making comments.php

Related articles

See more