码迷,mamicode.com
首页 > 其他好文 > 详细

wordpress学习系列2:模板和目录结构

时间:2015-04-29 13:19:34      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:

通常一个wp的theme必须的文件有:

404.php archive.php
attachment.php author.php
footer.php category.php
functions.php comments.php
header.php page.php
index.php search.php
single.php sidebar.php
style.css tag.php

 

这里不再对每个文件功能进行说明 ,相信都是一目了然的。

接下来我们开始编辑style.css , 开头通常都会有一些版权标识:

/*
Theme Name: Mini Theme
Theme URI: http://example.com/example/
Description: A search engine optimized website framework for WordPress. Author: Your name
Author URI: http://example.com/
Version: 1.0
Tags: Comma-separated tags that describe your theme.
...
*/

 

完成一个首页,我们需要涉及到3个文件:header.php / index.php / footer.php ,在index.php中调用 header.php和footer.php ,需要使用:

1 <?php get_header(); ?> // 导入头部
2 // index.php 中间部分
3 <?php get_footer(); ?> // 导入尾部

 

wordpress学习系列2:模板和目录结构

标签:

原文地址:http://www.cnblogs.com/simpleiseverything/p/4465588.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!