WordPress page Template making method and use

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

WordPress page Template making method and use

Because no similar tutorials have been found on the Internet, today mosquitoes write and share them here.

Usually touch a lot of people to use WP to achieve a lot of single page functions, such as message board, submission, link application, Taobao guest single page,

Many students do not know how to implement these functions, and there are few tutorials on the web.

In fact, since the WP support page settings after the function, these features are very simple.

The idea is to take advantage of WP's page template function, the proposal belongs to its own function page,

As long as you will html,php,css and so on, and understand the WP function, you can make their own characteristics of the page,

Of course, can also achieve WP home page of any form.

Below, the Mosquito explains the detailed steps:

First create your own page template

The files that define each page template can be found in the [appearance > Themes] directory.

To create a new custom page template for a page, you need to create a new file. Now we'll name this page template snarfer.php. At the top of the snarfer.php file, enter the following:

The above code defines the snarfer.php file as the "Snarfer" template. That is, WP defines the template method.

Description: Template name:snarfer This "snarfer" can be defined as we often see: submission, application links, message board and so on.

and template file "snarfer.php" This name can be arbitrarily modified, such as: tougao.php,links.php.

The template name appears in the skin theme editor and is used as a link to edit the file.

Example:

  

Description: This is the definition of the file about.php to about us for the template name.

It is your own business to define the contents of the template code above.

The rest of the code is the way the control page is displayed using the Snafer page template. You can look at the template tags available here in wordpress various template functions introduced. You can copy the contents of other templates (which can be page.php or index.php) into snarfer.php, and then add the five-element code at the beginning of the file, which is easier to do. As a result, you just need to make adjustments to HTML and PHP code without having to re-establish it. Once you have finished creating the page template, upload it to the topic directory, and then use it when you create or edit the page.

New page, select Page template

In the WP background, new page, page title to fill out, depending on the page you make the template is required to fill in,

Then select the page template you want to use in the page properties > Templates > Drop-down menu. As shown in the figure:

  

then click Publish.

The settings shown on the first page

If you want this page to be displayed on the homepage.

Please click on the settings > read > Home page > Click: a Static page (select below) in the Home Page option drop-down menu, select the pages you want to use, as shown in the picture:

  

Then we click Save Changes.

Can realize WP home page customization.

At this point, about the "WordPress page template production methods and use" of the content has been completed.

This article by the Mosquito original, the contribution A5. AC QQ925474725 (verification: A5)

Original link: http://www.menglei.info/1022/reproduced please link the form of the source, thank you for your cooperation.

Related Article

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.