Wp百科网主题模板制作教程
课程目标:制作出一个漂亮的主题
课后作业,跟着视频,完成一个相同主题的制作。
Wp百科网主题模板制作教程 ........................................................................................................ 1
1、wordpress模板结构分析 ........................................................................................................... 1
2、制作一个可以运行的wordpress主题,修改style.css ............................................................ 1
3、制作出主题结构,index.php,header.php,footer.php,sidebar.php ..................................... 2
4、修改header.php,footer.php ...................................................................................................... 2
5、制作sidebar.php ......................................................................................................................... 3
6、制作index.php, ........................................................................................................................ 3
7、制作single.php页面,加入评论 .............................................................................................. 4
8、制作page.php,archive.php,404.php...................................................................................... 4
9、制作小工具 ................................................................................................................................. 4
10、细节问题处理 ........................................................................................................................... 4
1、wordpress模板结构分析
索引页模版:index.php
顶部:header.php
文章页面模板:single.php
边栏模板:sidebar.php
底部:footer.php
页面模版:page.php
搜索结果:search.php
文章归档:archive.php
评论:comments.php
404 页面模版:404.php
主题支持函数:functions.php
样式表:style.css
2、制作一个可以运行的wordpress主题,修改style.css
制作一个最简单的主题,只需要两个文件,index.php和style.css
第一步,准备静态页面
第二步,制作index.php和style.css
第三步,给style.css添加版权信息 第四步:把主题上传到空间中wordpress安装路径,wp-content/themes/下面,这里主题的文件夹名字必须是英文
第五步,在wordpress后台启用主题
先给style.css添加版权信息
/*
Theme Name: wordpress theme 01
Theme URI:
Description: a simple bolg theme
Author: xixi
Author URI:
Version: 1.0
Tags: white, blog, liweihui, blue
*/
Style.css路径调用:
主题缩略图名字:screenshot.png
3、制作出主题结构,index.php,header.php,footer.php,sidebar.php
把index.php拆分成header.php,footer.php和sidebar.phhp
4、修改header.php,footer.php
新建一个index.php文件,header.php,footer.php,
这步需要用到的标签:
获取博客名字:
获取博客描述:
获取主页路径:
获取主题存放路径:
其他外部文件调用方法:
bloginfo('name'); } ?>
页面调用:
分类目录调用:
5、制作sidebar.php
最新文章:
日志标题太长超出,修改style.css,用到的代码:
text-overflow:ellipsis; white-space:nowrap; overflow:hidden;
随机文章:
$post) : ?>
标签云:
文章日期归档:
分类目录:
友情链接:
6、制作index.php,
调用文章内容:
调用文章内容摘要:
作者:
日期:
评论调用: