WordPress: Customizing page templates

Source: Internet
Author: User

Transferred from: http://jingyan.baidu.com/article/066074d6817060c3c21cb02e.html

<?php
/*
Template Name: Friend chain
*/
?>

This "friend Chain" is the title of the template selection.

Used for a while WordPress people will this wordpress: Custom page template. But there are many newbies who don't know the page template feature. Here is an introduction.

The role of page templates

Let WordPress pages have different layouts or styles. WordPress provides a page function that allows us to create different pages to show different content. such as contact information, message book and so on, many people like to build this. These pages are well established and can be customized with titles and content. But different pages, the layout is exactly the same, can not be changed according to their own needs and add. Sometimes we just want to add something to the sidebar of a page, such as a picture, so that you can customize the template to achieve a specific function of the page.

Method/Step
    1. 1

      Create a new PHP file in your theme directory using the FTP tool. For example: links.php (name Random).

    2. 2

      Edit the new file and add this code to the header of the file.

      <?php
      /*
      Template Name: Friend chain
      */
      ?>

    3. 3

      Copy the contents of your page.php directly into the links.php.

    4. 4

      Then find where you need to change in the links.php. I think, the most important change is the sidebar, one is the content of the article, as to how to change, depends on your needs.

    5. 5

      After modifying and saving the file, create a new page or modify the existing page. In the bottom right there is a "page template" Panel, in the drop-down menu, select "Friend Chain" to save it.

      END
Precautions
    • Links.php can be anything, not necessarily to copy the contents of page.php.

      You can even put HTML code in it without adding anything else.

WordPress: Customizing page templates

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.