<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[DjWing'S Blog]]></title> 
<link>http://www.djwing.com/index.php</link> 
<description><![CDATA[闲事莫理，众地莫站，百忍便成金！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[DjWing'S Blog]]></copyright>
<item>
<link>http://www.djwing.com/read.php?29</link>
<title><![CDATA[一项工程做下来的流程]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[杂碎一记]]></category>
<pubDate>Tue, 03 Aug 2010 04:20:45 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?29</guid> 
<description>
<![CDATA[ 
	<strong>第一部分：房地产开发公司的准备工作</strong> <br/><br/>在报行政机关审批之前，房地产开发公司应办理好土地出让手续，委托有资质的勘察设计院对待建项目进行研究并制作报告书,应附有详细的规划设计参数和效果图，并落实足够的开发资金。<br/>............<br/>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?28</link>
<title><![CDATA[Aly And Fila Feat Josie - Listening]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Mon, 31 May 2010 11:09:02 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?28</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=17" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>专辑 Listening<br/>艺人 Aly & Fila feat Josie<br/>发布 2010-05-30<br/>质量 320 kbps<br/><br/>1. Listening (Extended Mix)6:31<br/>2. Listening (Brave Remix)7:24<br/>3. Listening (Aurosonic Remix)8:33<br/>4. Listening (Philippe El Sisi Remix)8:54<br/><br/><a href="http://load2.me/?csDuhOuX" target="_blank">点击下载</a><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=trance" rel="tag">trance</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?27</link>
<title><![CDATA[Dave Emanuel - Four Noble Truths]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Mon, 31 May 2010 07:53:39 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?27</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=16" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>专辑 Four Noble Truths<br/>艺人 Dave Emanuel<br/>发布 2010-05-30<br/>质量 320 kbps<br/><br/>1. Four Noble Truths7:46<br/>2. Four Noble Truths (Evgeny Bardyuzha Remix)7:30<br/>3. Four Noble Truths (Mike Danis Remix)7:29<br/>4. Four Noble Truths (Masoud Remix)7:58<br/><br/><a href="http://load2.me/?gMz0pYuJ" target="_blank">点击下载</a><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=trance" rel="tag">trance</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?26</link>
<title><![CDATA[Aly and Fila - Rising Sun]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Mon, 31 May 2010 07:45:37 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?26</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=15" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>专辑 Rising Sun<br/>艺人 Aly & Fila<br/>发布 2010-05-28<br/>质量 320 kbps<br/><br/>01.&nbsp;&nbsp;Aly & Fila Vs Activa - Medellin03:36<br/>02.&nbsp;&nbsp;Aly & Fila Feat Katherine Crowe - it Will Be Ok05:21<br/>03.&nbsp;&nbsp;Aly & Fila Feat Denise Rivera - My Mind is with You06:58<br/>04.&nbsp;&nbsp;Aly & Fila - Rosaires06:37<br/>05.&nbsp;&nbsp;Aly & Fila Feat Josie - Listening03:38<br/>06.&nbsp;&nbsp;Aly & Fila - Menes (Original Mix)05:18<br/>07.&nbsp;&nbsp;Aly & Fila Feat Sue McLaren - Still03:54<br/>08.&nbsp;&nbsp;Aly & Fila Vs Bjorn Akesson - Perfect Red04:09<br/>09.&nbsp;&nbsp;Aly & Fila Feat Sue McLaren - I Can Hear You05:03<br/>10.&nbsp;&nbsp;Aly & Fila Vs Philippe El Sisi Feat Senadee - Without You (the Never 05:27<br/>11.&nbsp;&nbsp;Aly & Fila Feat Tiff Lacey - Paradise05:09<br/>12.&nbsp;&nbsp;Aly & Fila - Khepera04:58<br/>13.&nbsp;&nbsp;Aly & Fila - Sandgroper05:15<br/>14.&nbsp;&nbsp;Aly & Fila Feat Jass - Breeze03:53<br/>15.&nbsp;&nbsp;Aly & Fila - Rising Sun05:12<br/><br/><a href="http://load2.me/?FkpPYhcR" target="_blank">点击下载</a><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=trance" rel="tag">trance</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?25</link>
<title><![CDATA[Bartlett Bros Vs Mazza - Satellite Of Love]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Mon, 31 May 2010 07:40:03 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?25</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=14" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>专辑 Satellite Of Love<br/>艺人 Bartlett Bros vs Mazza<br/>发布 2010-05-30<br/>质量 320 kbps<br/><br/>1. Satellite Of Love (Extended Vocal Mix)7:21<br/>2. Satellite Of Love (Fabio XB Rework)8:08<br/>3. Satellite Of Love (Ronski Speed Remix)8:23<br/>4. Satellite Of Love (Claudia Cazacu Remix)7:25<br/>5. Satellite Of Love (Fabio XB Rework Dub Mix)7:55<br/>6. Satellite Of Love (Radio Edit)5:01<br/><br/><a href="http://load2.me/?l5tJ7Crt" target="_blank">点击下载</a><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=trance" rel="tag">trance</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?24</link>
<title><![CDATA[2006国际DJ大赛 DMC大赛]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Mon, 24 May 2010 14:45:50 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?24</guid> 
<description>
<![CDATA[ 
	<p align="center"><embed src="http://player.youku.com/player.php/sid/XMTQ4NTA4MDk2/v.swf" quality="high" width="580" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></p><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=dj" rel="tag">dj</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?23</link>
<title><![CDATA[网站页面过度特效代码]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[网页技术]]></category>
<pubDate>Sun, 16 May 2010 13:08:47 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?23</guid> 
<description>
<![CDATA[ 
	<div class="code">&lt;meta http-equiv=&quot;Page-Exit&quot; content=&quot;revealTrans(Duration=3,Transition=5)&quot;&gt;</div><br/><br/>此代码可以在链接其它页面的时候产生一种过度的特效，Duration 的值为网页动态过渡的时间，单位为秒。 Transition 是过渡方式，它的值为0到23，分别对应24种过渡方式。<br/><br/>如下：<br/><br/>0 盒状收缩<br/>1 盒状放射<br/>2 圆形收缩<br/>3 圆形放射<br/>4 由下往上<br/>5 由上往下<br/>6 从左至右<br/>7 从右至左<br/>8 垂直百叶窗<br/>9 水平百叶窗<br/>10 水平格状百叶窗<br/>11垂直格状百叶窗<br/>12 随意溶解<br/>13从左右两端向中间展开<br/>14从中间向左右两端展开<br/>15从上下两端向中间展开<br/>16从中间向上下两端展开<br/>17 从右上角向左下角展开<br/>18 从右下角向左上角展开<br/>19 从左上角向右下角展开<br/>20 从左下角向右上角展开<br/>21 水平线状展开<br/>22 垂直线状展开<br/>23 随机产生一种过渡方式<br/><br/><strong>附加一个网页淡入淡出效果</strong><br/><br/><div class="code">&lt;meta http-equiv=&quot;Page-Enter&quot; content=&quot;blendTrans(Duration=0.5)&quot;&gt;<br/>&lt;meta http-equiv=&quot;Page-Exit&quot; content=&quot;blendTrans(Duration=0.5)&quot;&gt;</div><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=%25E7%25BD%2591%25E7%25AB%2599" rel="tag">网站</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?22</link>
<title><![CDATA[雷蛇-炼狱蝰蛇（推荐）]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[杂碎一记]]></category>
<pubDate>Fri, 14 May 2010 23:08:38 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?22</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=9" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>3500dpi Razer Precision™ 3G 红外传感<br/>1000Hz Ultrapolling™ / 1ms 响应时间<br/>5个可独立编程的Hyperesponse按钮<br/>On-The-Fly Sensitivity 飞敏调整<br/>Always-On永久连接模式<br/>超大防滑按钮<br/>16位超宽数据通道<br/>6400 帧/秒（580 万像素/秒）<br/>最大速度60英寸/秒，最大加速度15g<br/>具有24个独立点击位置的滚轮<br/>超静Ultraslick Teflon支脚<br/>7英尺轻型无缠结芯线<br/>大体尺寸:128×70×42.5mm<br/><br/>炼狱蝰蛇入手已经大半年了，感觉蛮好的，价格也跌破300了，向打CS的朋友力推雷蛇系列炼狱蝰蛇！<br/><br/><p align="center"><img src="http://www.djwing.com/attachment.php?fid=8" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/><p align="center"><img src="http://www.djwing.com/attachment.php?fid=10" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/><p align="center"><img src="http://www.djwing.com/attachment.php?fid=11" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/><p align="center"><img src="http://www.djwing.com/attachment.php?fid=12" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/><p align="center"><img src="http://www.djwing.com/attachment.php?fid=13" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=%25E9%259B%25B7%25E8%259B%2587" rel="tag">雷蛇</a> , <a href="http://www.djwing.com/tag.php?tag=%25E9%25BC%25A0%25E6%25A0%2587" rel="tag">鼠标</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?21</link>
<title><![CDATA[21Years 混音特典 – Compiled and Mixed By Killer]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[电音无限]]></category>
<pubDate>Fri, 14 May 2010 21:32:52 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?21</guid> 
<description>
<![CDATA[ 
	<p align="center"><img src="http://www.djwing.com/attachment.php?fid=7" class="insertimage" alt="DjWing.Com" title="DjWing.Com" border="0"/></p><br/>中国电子音乐界备受瞩目音乐人Killer倾力制作，作为年轻且具有象征性的电音使者，Killer长久以来始终为中国的电子音乐乐迷带来不同的惊喜；在夏季到来的时候，刚满二十一岁的Killer为大家奉献了期待已久的混音作品21Years，在渐进的旋律中，亦令我们对Killer的后劲充满信心；聆听中国制作人的声音，来自NCM LABEL。<br/><br/>名称： 21Years 混音特典<br/>厂牌： NCM LABEL<br/>艺术家： Killer<br/>风格： Progressive<br/>日期： 2010年05月<br/>来源： Www.Newcnmix.Org<br/><br/>曲目列表：<br/>001.The Orange – Butterfly (Original Mix)Killer fix<br/>002.Roberto Bardini – Basic 2 (Dark Mix)<br/>003.Boom Jinx And Andrew Bayer – To The Six (Original Mix)<br/>004.Mat Zo – The Price Of Oil<br/>005.System F – Elevate (North State Remix)<br/>006.ID<br/>007.The Thrillseekers – Savanna (Alexander Popov Remix)<br/>008.Mike Shiver & Aruna – Everywhere You Are (Timo Juuti Mix)<br/>009.Velvetine – Safe (Wherever You Are) (Rank 1 Remix)<br/>010.EnMass – So Please 2010 (ft.Cari Golden)<br/>011.James Horner feat Leona Lewis – I See You (Cosmic Gare Remix)<br/>012.The Orange – UFO (Original Mix)<br/>013.ID<br/>014.Killer Pres.Compass – The Himalayas (Original Mix)<br/><br/><a href="http://www.newcnmix.org/works/NCM_21Years-Compiled_and_Mixed_By_Killer.rar" target="_blank">点击下载</a><br/>Tags - <a href="http://www.djwing.com/tag.php?tag=progressive" rel="tag">progressive</a>
]]>
</description>
</item><item>
<link>http://www.djwing.com/read.php?20</link>
<title><![CDATA[Wordpress 主题模板制作修改教程]]></title> 
<author>DjWing &lt;81178663@qq.com&gt;</author>
<category><![CDATA[网页技术]]></category>
<pubDate>Fri, 23 Apr 2010 08:18:53 +0000</pubDate> 
<guid>http://www.djwing.com/read.php?20</guid> 
<description>
<![CDATA[ 
	在一个完整的Wordpress 主题中都应该包含下列文件（也就是模板文件）：<br/>页面 模板文件 用途<br/>首页 index.php 显示网站首页<br/>单页 single.php 显示博文的页面（相当于细节页）<br/>静态页 page.php 显示静态页的页面（包含各级静态页面）<br/>分类页 category.php 显示分类页的页面（相当于栏目页）<br/>存档页 archive.php 显示存档页的页面（相当于按时间归类的栏目页）<br/>搜索页 search.php 显示搜索结果的页面<br/>评论页 comments.php 显示评论的页面<br/>弹出式评论页 comments-popup.php 显示弹出式评论的页面<br/>404错误页 404.php 显示 404 错误信息的页面<br/>级联样式表 style.css 控制页面布局外观<br/>除此之外，一套主题模板中还可以包含 author.php、home.php、date.php、searchform.php 以及 functions.php 等页面（其中部分页面稍后介绍）。<br/>虽然上面列出了与 Wordpress 内置功能对应的 9 个 php 文件，但制作一套主题远没有想像得那么复杂。因为事实上，你只需要制作一个 index.php 文件，就可以派生出另外 8 个文件来！<br/>从 Wordpress 应用主题的机制来说，这 9 个模板文件是存在优先级差别的，也可以认为是重要性不同。它们的优先级顺序是：<br/>index.php -> single.php -> page.php -> archive.php -> search.php -> 404.php。<br/>这样，当不存在后边的页面时，Wordpress 会自动调用前面的页面，直至调用 index.php。比如，当程序调用页面页 page.php 时，如果page.php 模板文件不存在，那么程序会尝试调用前面的文件－－single.php。而如果 single.php也不存在，那么就会调用最终的 index.php 来显示页面页。可见 index.php属于“垫底儿”的缺省页面，它的重要性是最高的。但当存在具体页面时，还是要优先使用具体的页面，可见具体的页面优先级最高。<br/>在明确了 index.php 是一套 Wordpress 主题的核心之后，我们就可以将制作 Wordpress 主题的过程简单地分成两步，即－－定义主模板文件 index.php 和派生其他模板文件。<br/>定义主模板文件 index.php从页面布局的角度上，有必要将主模板文件 index.php 拆分成 header.php、sidebar.php 和footer.php 三个子页面。Wordpress 专门为在 index.php 中包含这三个子页面提供了对应的get_header()、get_sidebar() 和 get_footer() 函数。<br/>下面，就来详细介绍一下制作 index.php 页面的过程：<br/>首先，在 myThemes 文件夹中建立一个文本文件并将其重命名为 index.php，然后再建立一个 style.css 文件（内容暂时留空）。<br/>然后，用你喜欢的文本编辑器打开 index.php 并输入下列代码（最好复制，因为这一部分不重要）：<br/><div class="code">&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“&gt;<br/>&lt;html xmlns=”http://www.w3.org/1999/xhtml“&gt;<br/>&lt;head profile=”http://gmpg.org/xfn/11“&gt;<br/>&lt;meta http-equiv=”Content-Type” content=”&lt;?php bloginfo(’html_type’); ?&gt;;<br/>charset=&lt;?php bloginfo(’charset’); ?&gt;” /&gt;<br/>&lt;title&gt;&lt;?php bloginfo(’name’); ?&gt; &lt;?php if ( is_single() ) &#123; ?&gt; &amp;raquo; Blog Archive &lt;?php &#125; ?&gt;<br/>&lt;?php wp_title(); ?&gt;&lt;/title&gt;<br/>&lt;meta name=”generator” content=”WordPress &lt;?php bloginfo(’version’); ?&gt;” /&gt;<br/>&lt;!– leave this for stats –&gt;<br/>&lt;link rel=”stylesheet” href=”&lt;?php bloginfo(’stylesheet_url’); ?&gt;”<br/>type=”text/css” media=”all” /&gt;<br/>&lt;link rel=”stylesheet” href=”&lt;?php bloginfo(’stylesheet_directory’); ?&gt;<br/>/print.css” type=”text/css” media=”print” /&gt;<br/>&lt;link rel=”alternate” type=”application/rss+xml” title=”&lt;?php bloginfo(’name’); ?&gt;<br/>RSS Feed” href=”&lt;?php bloginfo(’rss2_url’); ?&gt;”/&gt;<br/>&lt;link rel=”pingback” href=”&lt;?php bloginfo(’pingback_url’); ?&gt;” /&gt;<br/>&lt;?php wp_head(); ?&gt;<br/>&lt;/head&gt;<br/>&lt;body &gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;</div><br/>显然，这是一些构成网页文件的 HTML 代码，当然其中包含 PHP 代码。如前所述，HTML 代码定义结构，而 PHP 代码用于生成内容。<br/>在 Wordpress 后台的“主题”模块中，选择 myTheme 主题。然后，在浏览器中观察你的 Wordpress 外观。此时，应该显示页面一片空白。但通过“查看源文件”，你会发现 index.php 中的 PHP 代码已经生成了一些头部内容。<br/>接着，我们开始动手定义 index.php 中 body 部分的结构和内容。<br/>（一）构建 header在 body 元素内，新建如下结构化标记元素，注意各元素都带有不同的 id 属性：<br/><div class="code">&lt;div id=”page”&gt;<br/>&lt;div id=”header”&gt;&lt;/div&gt;<br/>&lt;div id=”content”&gt;&lt;/div&gt;<br/>&lt;div id=”sidebar”&gt;&lt;/div&gt;<br/>&lt;div id=”footer”&gt;&lt;/div&gt;<br/>&lt;/div&gt;</div><br/>然后，在该 <div id=”header”></div> 元素的两个标签之间输入下列代码：<br/><div class="code">&lt;h1&gt;&lt;a href=”&lt;?php bloginfo(’url’); ?&gt;”title=”&lt;?php bloginfo(’name’); ?&gt;”&gt;&lt;?php bloginfo(’name’);?&gt;&lt;/a&gt;&lt;/h1&gt;<br/>&lt;p&gt;&lt;?php bloginfo(’description’); ?&gt;&lt;/p&gt;</div><br/>这里用到了 Wordpress 内置的 bloginfo 函数来生成内容，其中：<br/><div class="code">bloginfo(’url’)返回网站主页链接；<br/>bloginfo(’name’)返回网站标题；<br/>bloginfo(’description’)返回网站描述。</div><br/>保存 index.php 文件，然后在浏览器中按 F5 刷新一下页面，看能看到什么？再通过“查看源文件”，核对一下由 Wordpress 的 bloginfo() 函数生成的相关信息。<br/>（二）构建 content在 <div id=”content”></div> 中，我们要通过循环显示博文，包括每个博文的标题、作者、发表日期以及其他相关信息。并且，可以分页显示博文（取决于 Wordpress 后台的设置）。<br/>首先，在 <div id=”content”> 与 </div> 之间输入下列代码：<br/><div class="code">&lt;?php while (have_posts()) : the_post(); ?&gt; &lt;div class=”post” id=”post-&lt;?php the_ID() ?&gt;”&gt;<br/>&lt;!– 博文标题及链接 –&gt;<br/>&lt;h2&gt;&lt;a href=”&lt;?php the_permalink() ?&gt;” rel=”bookmark” title=”&lt;?php the_title(); ?&gt;”&gt;<br/>&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;<br/>&lt;!– 发表日期 –&gt;<br/>&lt;div class=”post-date”&gt;<br/>&lt;span class=”post-month”&gt;&lt;?php the_time(’M’) ?&gt;&lt;/span&gt;<br/>&lt;span class=”post-day”&gt;&lt;?php the_time(’d’) ?&gt;&lt;/span&gt;<br/>&lt;/div&gt;<br/>&lt;!– 作者 –&gt;<br/>&lt;span class=”post-author”&gt;&lt;?php _e(’Author’); ?&gt;：&lt;?php the_author(’, ‘) ?&gt;&lt;/span&gt;<br/>&lt;!– 类别 –&gt;<br/>&lt;span class=”post-cat”&gt;&lt;?php _e(’Categories’); ?&gt;：&lt;?php the_category(’, ‘) ?&gt;&lt;/span&gt;<br/>&lt;!– 注释 –&gt;<br/>&lt;span class=”post-comments”&gt;<br/>&lt;?php comments_popup_link(’No Comments &amp;raquo;’, ‘1 Comment &amp;raquo;’, ‘% Comments &amp;raquo;’); ?&gt;&lt;/span&gt;<br/>&lt;!– 内容 –&gt;<br/>&lt;div class=”entry”&gt;<br/>&lt;?php the_content(’更多内容 &amp;raquo;’); ?&gt;<br/>&lt;/div&gt;<br/>&lt;!– 其他元（Meta）数据 –&gt;<br/>&lt;div class=”post-meta”&gt;<br/>&lt;?php edit_post_link(’编辑’,’ &#124; ‘,”); ?&gt;<br/>&lt;/div&gt; &lt;/div&gt;<br/>&lt;?php endwhile; ?&gt;&lt;div class=”navigation”&gt;<br/>&lt;span class=”previous-entries”&gt;&lt;?php next_posts_link(’前一篇’)?&gt;&lt;/span&gt; &lt;span class=”next-entries”&gt;&lt;?phpprevious_posts_link(’后一篇’) ?&gt;&lt;/span&gt;<br/>&lt;/div&gt;<br/>&lt;?php else : ?&gt;<br/>&lt;div class=”post”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Not Found’); ?&gt;&lt;/h2&gt;<br/>&lt;/div&gt;&lt;?php endif; ?&gt;</div><br/>看似复杂，其实不然。首先：<br/><div class="code">&lt;?php if (have_posts()) : ?&gt;<br/>&lt;?php else : ?&gt;<br/>&lt;?php endif; ?&gt;</div><br/>这三行，在 Wordpress 中表示 if 控制结果。注意，if 语句通过测试 have_posts() 函数来测试是否存在博文。而<br/><div class="code">&lt;?php while (have_posts()) : the_post(); ?&gt;<br/>&lt;?php endwhile; ?&gt;</div><br/>这两行，是 Wordpress 中的 while 循环。其中，while 语句通过测试 have_posts() 决定是否调用 the_post()函数。如果测试 have_posts() 返回 true，则调用 the_post() 函数，初始化与博文相关的内置变量。<br/>在 while 循环内部，首先要注意通过 div、h2、span 这三个元素定义的嵌套语义结构，以及相应元素的 class 和 id属性（其中只为 class 为 post 的 div 元素定义了一个 id 属性－－post-<?php the_ID()?>）。这是将来使用 CSS 控制外观的关键所在。在这个 div 元素中，为显示博文的相关信息，分别调用了以下 Wordpress 函数：<br/><div class="code">the_ID()：返回博文 ID；<br/>the_permalink()：返回博文固定链接 URL；<br/>the_title()：返回博文标题；<br/>the_time(’M’)：返回发表日期中的月份；<br/>the_time(’d’)：返回发表日期中的天；<br/>the_author()：返回博文作者；<br/>the_category()：返回博文的类别；<br/>the_content()：返回博文的内容，其中的参数表示用于“更多内容”的链接文本；</div><br/>以上函数都是以 the_ 开头的，加上后面的函数名不仅颇有自解释的味道，而且令人联想到 this 关键字。此外<br/>_e() 函数是一个包装函数，这个函数主要用于语言的转换，如果调用该函数并传递标准的 Wordpress 术语，如：Author 或 Categories，则返回你相应语言包中的译文，在中文包中分别是“作者”和“类别”。当然，不用也可。但会失去一些适应性。<br/>还有，omments_popup_link() 和 edit_post_link() 两个函数，分别显示注释和编辑链接，这里不多说了。<br/>另外，在 <?php endwhile; ?> 后面显示了分页导航链接，调用的函数分别是：next_posts_link() 和previous_posts_link()。此时，如果你的博文总数小于 Wordpress 后台设置的最多显示数目，比如：你在后台设置最多显示 5篇，而你有 10 篇博文，就会分页显示；否则，如果你的博文少于或等于 5 篇则看不到分页导航链接。<br/>最后，不要丢下 <?php else : ?> 语句后面的内容：<br/><div class="code">&lt;div class=”post”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Not Found’); ?&gt;&lt;/h2&gt;<br/>&lt;/div&gt;</div><br/>显然，这是一个错误提示信息。<br/>（三）构建 sidebarsidebar 的内容当然要在 <div id=”sidebar”></div> 元素中构建了。sidebar，中文叫侧边栏，其中可以包含很多内容。比如：分类、页面、链接、日历等等导航及相关信息。<br/>在 WP 中，sidebar 中的内容都以无序（ul）或有序（ol）列表的形式输出。因此，需要在 <div id=”sidebar”></div> 中输入以下标记：<br/><div class="code">&lt;ul&gt;<br/>&lt;?php if ( !function_exists(’dynamic_sidebar’) &#124;&#124; !dynamic_sidebar() ) : ?&gt;<br/>&lt;li id=”search”&gt;<br/>&lt;?php include(TEMPLATEPATH .’/searchform.php’); ?&gt;<br/>&lt;/li&gt; &lt;li id=”calendar”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Calendar’); ?&gt;&lt;/h2&gt;<br/>&lt;?php get_calendar(); ?&gt;<br/>&lt;/li&gt; &lt;?php wp_list_pages(’title_li=&lt;h2&gt;页面&lt;/h2&gt;’); ?&gt; &lt;li class=”catnav”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Categories’); ?&gt;&lt;/h2&gt;<br/>&lt;ul&gt;<br/>&lt;?php wp_list_cats(’sort_column=name&amp;optioncount=1&amp;hierarchical=0′); ?&gt;<br/>&lt;/ul&gt;<br/>&lt;/li&gt;<br/>&lt;li class=”archivesnav”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Archives’); ?&gt;&lt;/h2&gt;<br/>&lt;ul&gt;<br/>&lt;?php wp_get_archives(’type=monthly’); ?&gt;<br/>&lt;/ul&gt;<br/>&lt;/li&gt;<br/>&lt;li class=”blogrollnav”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Links’); ?&gt;&lt;/h2&gt;<br/>&lt;ul&gt;<br/>&lt;?php get_links(’-1′, ‘&lt;li&gt;’, ‘&lt;/li&gt;’, ‘&lt;br /&gt;’, FALSE, ‘id’, FALSE, FALSE, -1, FALSE); ?&gt;<br/>&lt;/ul&gt;<br/>&lt;/li&gt;<br/>&lt;li class=”meta”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Meta’); ?&gt;&lt;/h2&gt;<br/>&lt;ul&gt;&lt;?php wp_register(); ?&gt;&lt;li&gt;&lt;?php wp_loginout(); ?&gt;&lt;/li&gt;<br/>&lt;?php wp_meta(); ?&gt;&lt;/ul&gt;<br/>&lt;/li&gt;<br/>&lt;?php endif ?&gt;<br/>&lt;/ul&gt;</div><br/>以上代码从第三行开始，分别通过包含 searchform.php 显示搜索表单；<br/><div class="code">调用 get_calendar() 函数显示日历；<br/>调用 wp_list_pages() 函数显示页面导航；<br/>调用 wp_list_cats() 函数显示分类导航；<br/>调用 wp_get_archives() 函数显示存档导航；<br/>调用 get_links() 函数显示链接导航。</div><br/>在构建侧边栏时，要为生成搜索框新建一个 searchform.php 文件，其内容如下：<br/><div class="code">&lt;form method=”get” id=”searchform” action=”&lt;?php bloginfo(’home’); ?&gt;/”&gt;<br/>&lt;div&gt;<br/>&lt;input type=”text” value=”&lt;?php echo wp_specialchars($s, 1); ?&gt;” name=”s” id=”s” size=”15″ /&gt;&lt;br /&gt;<br/>&lt;input type=”submit” id=”searchsubmit” value=”Search” /&gt;<br/>&lt;/div&gt;<br/>&lt;/form&gt;</div><br/>将其保存在 myTheme 文件夹中，通过 include 语句包含进来就可以了。注意，常量 TEMPLATEPATH 中保存的是模板路径。<br/>最后，说明一下以上代码第二行和倒数第二行。显然这是一个 if 语句块。那这个 if 语句块包含 sidebar是何用意呢？这是部件化侧边栏的需要，就是让 sidebar 适合 Widget 插件（WP 2.0 后内置了Widget，所以不用再安装了）。如果要使用 Widget 插件，必须对 sidebar 进行部件化。这样，在 Wordpress 后台通过 Widget插件你就可以使用拖动来方便地定义侧边栏的组件了。部件化侧边栏，除了在 ul 元素内侧放入这个 if 语句之外，还必须在 myTheme文件夹中建立一个文件 functions.php，其内容如下：<br/><div class="code">&lt;?php<br/>if ( function_exists(’register_sidebar’) )<br/>register_sidebar(array(<br/>‘before_widget’ =&gt; ‘&lt;li id=”%1$s” class=”widget %2$s”&gt;’,<br/>‘after_widget’ =&gt; ‘&lt;/li&gt;’,<br/>‘before_title’ =&gt; ‘&lt;h2 class=”sidebartitle”&gt;’,<br/>‘after_title’ =&gt; ‘&lt;/h2&gt;’,<br/>));<br/>?&gt;</div><br/>（四）构建 footerfooter 中一般都一些版权信息和不太重要的链接。所以可以在 <div id=”footer”></div> 元素中简单地放入下列代码：<br/><p>Copyright &copy; 2007 <?php bloginfo(’name’); ?></p><br/>至此，核心 index.php 文件就算是大功告成了！<br/>接下来，是拆分 index.php 和基于 index.php 派生子模板文件。<br/>在 myTheme 文件夹中新建 header.php、sidebar.php 和 footer.php 三个文件。把index.php 中的 <div id=”header”></div>、<divid=”sidebar”></div> 和 <div id=”footer”></div>三个结构化元素及其内容分别转移（剪切）到这三个新文件中。然后，在 <div id=”header”></div>原来的位置处输入代码：<br/><div class="code">&lt;?php get_header();?&gt;</div><br/>在 <div id=”sidebar”></div> 原来的位置处输入代码：<br/><div class="code">&lt;?php get_sidebar();?&gt;</div><br/>在 <div id=”footer”></div> 原来的位置处输入代码：<br/><div class="code">&lt;?php get_footer();?&gt;</div><br/>前面说过，这三个 get 函数是 Wordpress 专门为包含结构化的文件定义的。现在你的 index.php 文件应该如下所示：<br/><div class="code">&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“&gt;<br/>&lt;html xmlns=”http://www.w3.org/1999/xhtml“&gt;&lt;head profile=”http://gmpg.org/xfn/11“&gt;<br/>&lt;meta http-equiv=”Content-Type” content=”&lt;?phpbloginfo(’html_type’); ?&gt;; charset=&lt;?php bloginfo(’charset’);?&gt;” /&gt;&lt;title&gt;&lt;?php bloginfo(’name’); ?&gt; &lt;?php if (is_single() ) &#123; ?&gt; &amp;raquo; Blog Archive &lt;?php &#125; ?&gt; &lt;?phpwp_title(); ?&gt;&lt;/title&gt;&lt;meta name=”generator”content=”WordPress &lt;?php bloginfo(’version’); ?&gt;” /&gt; &lt;!–leave this for stats –&gt;&lt;link rel=”stylesheet” href=”&lt;?phpbloginfo(’stylesheet_url’); ?&gt;” type=”text/css” media=”all” /&gt;<br/>&lt;link rel=”stylesheet” href=”&lt;?php bloginfo(’stylesheet_directory’); ?&gt;/print.css” type=”text/css” media=”print” /&gt;<br/>&lt;link rel=”alternate” type=”application/rss+xml” title=”&lt;?phpbloginfo(’name’); ?&gt; RSS Feed” href=”&lt;?php bloginfo(’rss2_url’);?&gt;” /&gt;<br/>&lt;link rel=”pingback” href=”&lt;?php bloginfo(’pingback_url’); ?&gt;” /&gt;&lt;?php wp_head(); ?&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>&lt;div id=”page”&gt;&lt;?php get_header(); ?&gt; &lt;!– content –&gt;<br/>&lt;div id=”content”&gt;<br/>&lt;?php if (have_posts()) : ?&gt;<br/>&lt;?php while (have_posts()) : the_post(); ?&gt; &lt;div class=”post” id=”post-&lt;?php the_ID() ?&gt;”&gt;<br/>&lt;!– 博文标题及链接 –&gt;<br/>&lt;h2&gt;&lt;a href=”&lt;?php the_permalink() ?&gt;” rel=”bookmark” title=”&lt;?php the_title(); ?&gt;”&gt;<br/>&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;<br/>&lt;!– 发表日期 –&gt;<br/>&lt;div class=”post-date”&gt;<br/>&lt;span class=”post-month”&gt;&lt;?php the_time(’M’) ?&gt;&lt;/span&gt;<br/>&lt;span class=”post-day”&gt;&lt;?php the_time(’d’) ?&gt;&lt;/span&gt;<br/>&lt;/div&gt;<br/>&lt;!– 作者 –&gt;<br/>&lt;span class=”post-author”&gt;&lt;?php _e(’Author’); ?&gt;：&lt;?php the_author(’, ‘) ?&gt;&lt;/span&gt;<br/>&lt;!– 类别 –&gt;<br/>&lt;span class=”post-cat”&gt;&lt;?php _e(’Categories’); ?&gt;：&lt;?php the_category(’, ‘) ?&gt;&lt;/span&gt;<br/>&lt;!– 注释 –&gt;<br/>&lt;span class=”post-comments”&gt;<br/>&lt;?php comments_popup_link(’No Comments &amp;raquo;’, ‘1 Comment &amp;raquo;’, ‘% Comments &amp;raquo;’); ?&gt;&lt;/span&gt;<br/>&lt;!– 内容 –&gt;<br/>&lt;div class=”entry”&gt;<br/>&lt;?php the_content(’更多内容 &amp;raquo;’); ?&gt;<br/>&lt;/div&gt;<br/>&lt;!– 其他元（Meta）数据 –&gt;<br/>&lt;div class=”post-meta”&gt;<br/>&lt;?php edit_post_link(’编辑’,’ &#124; ‘,”); ?&gt;<br/>&lt;/div&gt; &lt;/div&gt;<br/>&lt;?php endwhile; ?&gt; &lt;div class=”navigation”&gt;<br/>&lt;span class=”previous-entries”&gt;&lt;?php next_posts_link(’前一篇’)?&gt;&lt;/span&gt; &lt;span class=”next-entries”&gt;&lt;?phpprevious_posts_link(’后一篇’) ?&gt;&lt;/span&gt;<br/>&lt;/div&gt;<br/>&lt;?php else : ?&gt;<br/>&lt;div class=”post”&gt;<br/>&lt;h2&gt;&lt;?php _e(’Not Found’); ?&gt;&lt;/h2&gt;<br/>&lt;/div&gt;&lt;?php endif; ?&gt;<br/>&lt;/div&gt;&lt;!– end content –&gt;&lt;?php get_sidebar(); ?&gt; &lt;?php get_footer(); ?&gt;&lt;/div&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;</div><br/>然后，是派生子模板文件。把这个“模块化”的 index.php 文件另存为single.php、page.php、archive.php、 search.php 和 category.php。当然，都保存在myTheme 文件夹中。这样，Wordpress 在显示页面时就会调用相应的页面文件了。比如，显示博文详细内容时，会调用single.php；而显示页面内容时，则调用 page.php。<br/>Tags - <a href="http://www.djwing.com/tag.php?tag=wordpress" rel="tag">wordpress</a> , <a href="http://www.djwing.com/tag.php?tag=%25E4%25B8%25BB%25E9%25A2%2598" rel="tag">主题</a> , <a href="http://www.djwing.com/tag.php?tag=%25E6%25A8%25A1%25E6%259D%25BF" rel="tag">模板</a> , <a href="http://www.djwing.com/tag.php?tag=%25E6%2595%2599%25E7%25A8%258B" rel="tag">教程</a>
]]>
</description>
</item>
</channel>
</rss>