wordpress - Written by konging on 2008.06.02 5:15 - 2 Comments

wordpress主题-从零开始

接触wordpress没有多长时间,已经被它的易用性和超强的自定义功能深深吸引。于是便想做一个wordpress模板学习一下,从零开始做吧:

  1. 在自己的电脑上搭建php+mysql的环境,本地修改,预览快得多
  2. 新建index.php,书写最基本的wordpress输出模块,
  3. 把index.php中的header,siderbar,footer部分分别剪切到header.php,sidebar.php,footer.php,在用get_header()等函数连接
  4. 新建single.php,把index.php中的内容copy进去,在用comments_template()函数连接评论模块
  5. 新建page.php, 把index.php中的内容copy进去,删除post的loop循环,修改为 the_content()函数
  6. 新建search.php,同样copy index.php中的内容
  7. 新建comment.php (这里是复制的别人的,没学过php)

这样一个最基本的,超级小的模板就完成了,当然显示出来的样子有点难以接受。写了style.css美化了一下,增加了function.php使侧边栏支持widget …………还有很多很多工作未完成,看来让一个模板变得像样一点还得有些时间。

通过从无到有的主题制作,对wordpress的主题结构有了充分了解,书写css的时候,也学了不少新的东西。(还学了几个英文单词。。。)

相关日志



2 Comments

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

  1. cnpabi 说:

    分享了。。。。

  2. Hemorrhoid 说:

    Great, thanks!

Leave a Reply

Comment

  • 网名 : 夕遥
  • 职业 : 初中物理教师
  • QQ : 173155414
  • Email : purewheat#gmail.com
  • 格言 : 永远年轻,永远热泪盈眶

More In


More In


More In