CQ-CSER

计算机爱好者

How to: Create and use WordPress page templates

Posted on | 十一月 27, 2009 | 1 Comment

Page templates are very useful: They allow you to creates custom pages, for exemple creating an archive page which will list all your posts, or a page to display infos about the author.
A page template is defined by the following code, inserted on the firsts lines of the file:

<?php
/*
Template Name: Archives
*/
?>

Here, we just created a page template, named “Archives”.

To use it on your theme, write a page, and scroll down until you see a “Page Template” dropdown list, as described in the picture below:

Create and use WordPress page templates

Then you just have to choose which page template to use, and save the page

相关文章:

  1. create-an-options-page-for-your-WordPress-theme
  2. How to: Display any rss feed on your WordPress blog【Z】
  3. 7 Must Have WordPress Plugins For Every Blog
  4. WordPress 永久链接以及在各种平台上的实现方法
  5. xampp

评论|Comments

One Response to “How to: Create and use WordPress page templates”

  1. How to: Create and use WordPress page templates | ShareFavorite
    十一月 27th, 2009 @ 12:07

    [...] the original:  How to: Create and use WordPress page templates Related [...]

留言|Leave a Reply





  • Archives

  • SUNSHINE

  • About

    本博客采用创作共用版权协议,要求署名、非商业用途和保持一致. 转载本博客内容也遵循“署名-非商业用途-保持一致”的创作共用协议.

    订阅

    Search

    Admin