<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>陈志伟博客 &#187; wordpress</title>
	<atom:link href="http://chenzhiwei.net/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://chenzhiwei.net</link>
	<description>善始者实繁，克终者盖寡。</description>
	<lastBuildDate>Sat, 17 Mar 2012 04:16:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>博客最近的更新</title>
		<link>http://chenzhiwei.net/2011/01/recently-blog-update/</link>
		<comments>http://chenzhiwei.net/2011/01/recently-blog-update/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 09:25:10 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[个人日志]]></category>
		<category><![CDATA[建站相关]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[博客]]></category>
		<category><![CDATA[邮件列表]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30418</guid>
		<description><![CDATA[快到年底了，公司里开始忙了，所以我最近这两个周没时间更新博客。以前在学校时一直想着早点工作，现在工作后才发现，其实工作和上学只是彼此彼此的关系。 前段时间工作比较轻松，我就用织梦系统建了个网站，在此期间我又学习了一些关于SEO的知识，索性也给自己博客加上了google sitemap。关于google sitemap功能，我用的是simple google sitemap for wordpress插件，因为自己的博客文件是放在域名子目录下的，所以我就修改了该插件的部分代码，使其适合我的博客使用。 有兴趣的同学可以围观一下我的google sitemap。 另外，我博客也加上了QQ邮件列表功能，将那个google feedburner订阅的地方修改了一下，现在直接输入电子邮箱就可以订阅我博客的更新了，更适合在大陆的同学使用。如果你对我博客内容感兴趣，不妨用邮件订阅一下，当然你也可以通过以下地址来进行邮件订阅：http://list.qq.com/cgi-bin/qf_invite?id=f00d2298c8fb35c385bd928b9afbe33092560d9e749460ab 还有就是我博客已经关闭了wordpress中该死的Post Revisions和Autosave功能，因为即便是关闭Post Revisions功能Autosave功能还会产生一篇Post Revision，索性就直接将Autosave也一并关闭。。。关于Post Revisions功能的的相关介绍具体信息可以看wordpress官方文档。 这次就写这么多，忙。。。 &#169; 2011, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2011/01/recently-blog-update/相关日志wordpress主题常用的代码博客又一次搬家写博客获80童年大礼包随写提前祝博客访客及博友们新年快乐]]></description>
			<content:encoded><![CDATA[<p>快到年底了，公司里开始忙了，所以我最近这两个周没时间更新博客。以前在学校时一直想着早点工作，现在工作后才发现，其实工作和上学只是彼此彼此的关系。<span id="more-30418"></span></p>
<p>前段时间工作比较轻松，我就用<a href="http://www.dedecms.com" target="_blank">织梦系统</a>建了个网站，在此期间我又学习了一些关于SEO的知识，索性也给自己博客加上了<a href="http://chenzhiwei.net/sitemap.xml" target="_blank">google sitemap</a>。关于google sitemap功能，我用的是<a href="http://wordpress.org/extend/plugins/simple-google-sitemap/" target="_blank">simple google sitemap for wordpress</a>插件，因为自己的博客文件是放在域名子目录下的，所以我就修改了该插件的部分代码，使其适合我的博客使用。 有兴趣的同学可以围观一下我的<a href="http://chenzhiwei.net/sitemap.xml">google sitemap</a>。</p>
<p>另外，我博客也加上了<a href="http://list.qq.com" target="_blank">QQ邮件列表</a>功能，将那个google feedburner订阅的地方修改了一下，现在直接输入电子邮箱就可以订阅我博客的更新了，更适合在大陆的同学使用。如果你对我博客内容感兴趣，不妨用邮件订阅一下，当然你也可以通过以下地址来进行邮件订阅：<a href="http://list.qq.com/cgi-bin/qf_invite?id=f00d2298c8fb35c385bd928b9afbe33092560d9e749460ab" target="_blank">http://list.qq.com/cgi-bin/qf_invite?id=f00d2298c8fb35c385bd928b9afbe33092560d9e749460ab</a></p>
<p>还有就是我博客已经关闭了wordpress中该死的Post Revisions和Autosave功能，因为即便是关闭Post Revisions功能Autosave功能还会产生一篇Post Revision，索性就直接将Autosave也一并关闭。。。关于Post Revisions功能的的相关介绍具体信息可以看<a href="http://codex.wordpress.org/Revision_Management" target="_blank">wordpress官方文档</a>。</p>
<p>这次就写这么多，忙。。。</p>
<p style="font-weight: bold;">&copy; 2011, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="博客最近的更新" href="http://chenzhiwei.net/2011/01/recently-blog-update/">http://chenzhiwei.net/2011/01/recently-blog-update/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2009/11/move-blog-again/" title="博客又一次搬家">博客又一次搬家</a></li><li><a href="http://chenzhiwei.net/2011/12/blog-hongluotuo-act/" title="写博客获80童年大礼包">写博客获80童年大礼包</a></li><li><a href="http://chenzhiwei.net/2011/10/write-write/" title="随写">随写</a></li><li><a href="http://chenzhiwei.net/2011/01/happy-spring-festival-2011/" title="提前祝博客访客及博友们新年快乐">提前祝博客访客及博友们新年快乐</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2011/01/recently-blog-update/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>不用插件实现wordpress分页导航的方法</title>
		<link>http://chenzhiwei.net/2010/12/display-pagination-without-plugin/</link>
		<comments>http://chenzhiwei.net/2010/12/display-pagination-without-plugin/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 01:42:24 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30402</guid>
		<description><![CDATA[一直想把自己博客主题里的代码拿出晒晒，今天就晒一下博客分页导航的代码。很多同学应该都听说过wp-pagenavi吧，这是一个很优秀的wordpress分页导航插件，我使用了很长时间。就在前段时间，我下载了一个国外wordpress主题（已经忘记是哪个了），看到里主题里面的分页导航代码，于是就拿来用了。 不多说了，直接上代码： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 [...]]]></description>
			<content:encoded><![CDATA[<p>一直想把自己博客主题里的代码拿出晒晒，今天就晒一下博客分页导航的代码。很多同学应该都听说过wp-pagenavi吧，这是一个很优秀的wordpress分页导航插件，我使用了很长时间。就在前段时间，我下载了一个国外wordpress主题（已经忘记是哪个了），看到里主题里面的分页导航代码，于是就拿来用了。<span id="more-30402"></span></p>
<p>不多说了，直接上代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * PAGINATION
 * Retrieve or display pagination code.
 *
 * The defaults for overwriting are:
 * 'page' - Default is null (int). The current page. This function will
 *      automatically determine the value.
 * 'pages' - Default is null (int). The total number of pages. This function will
 *      automatically determine the value.
 * 'range' - Default is 3 (int). The number of page links to show before and after
 *      the current page.
 * 'gap' - Default is 3 (int). The minimum number of pages before a gap is 
 *      replaced with ellipses (...).
 * 'anchor' - Default is 1 (int). The number of links to always show at begining
 *      and end of pagination
 * 'before' - Default is '&lt;div class=&quot;emm-paginate&quot;&gt;' (string). The html or text 
 *      to add before the pagination links.
 * 'after' - Default is '&lt;/div&gt;' (string). The html or text to add after the
 *      pagination links.
 * 'title' - Default is '__('Pages:')' (string). The text to display before the
 *      pagination links.
 * 'next_page' - Default is '__('&amp;raquo;')' (string). The text to use for the 
 *      next page link.
 * 'previous_page' - Default is '__('&amp;laquo')' (string). The text to use for the 
 *      previous page link.
 * 'echo' - Default is 1 (int). To return the code instead of echo'ing, set this
 *      to 0 (zero).
 *
 * @author Eric Martin &lt;eric@ericmmartin.com&gt;
 * @copyright Copyright (c) 2009, Eric Martin
 * @version 1.0
 *
 * @param array|string $args Optional. Override default arguments.
 * @return string HTML content, if not displaying.
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> emm_paginate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$defaults</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pages'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> 
		<span style="color: #0000ff;">'range'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gap'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'anchor'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'before'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;div class=&quot;emm-paginate&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'after'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;b&gt;页码&lt;/b&gt;:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'nextpage'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'previouspage'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;laquo; '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'echo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> wp_parse_args<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$defaults</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #339933;">,</span> EXTR_SKIP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$page</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'paged'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$posts_per_page</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span>get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_per_page'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">found_posts</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$posts_per_page</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
		<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$before</span>&lt;span class='emm-title'&gt;<span style="color: #006699; font-weight: bold;">$title</span>&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$ellipsis</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;span class='emm-gap'&gt;...&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$previouspage</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_pagenum_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' class='emm-prev'&gt;<span style="color: #006699; font-weight: bold;">$previouspage</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$min_links</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$range</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$block_min</span> <span style="color: #339933;">=</span> <span style="color: #990000;">min</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$range</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$min_links</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$block_high</span> <span style="color: #339933;">=</span> <span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$range</span><span style="color: #339933;">,</span> <span style="color: #000088;">$min_links</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$left_gap</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$block_min</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$anchor</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$gap</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$right_gap</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$block_high</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$anchor</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$gap</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$left_gap</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$right_gap</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%s%s%s'</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$anchor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
				<span style="color: #000088;">$ellipsis</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #000088;">$block_min</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$left_gap</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$right_gap</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%s%s%s%s%s'</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$anchor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
				<span style="color: #000088;">$ellipsis</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #000088;">$block_min</span><span style="color: #339933;">,</span> <span style="color: #000088;">$block_high</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
				<span style="color: #000088;">$ellipsis</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$anchor</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$right_gap</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$left_gap</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%s%s%s'</span><span style="color: #339933;">,</span> 
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$block_high</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #000088;">$ellipsis</span><span style="color: #339933;">,</span>
				emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$anchor</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nextpage</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_pagenum_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' class='emm-next'&gt;<span style="color: #006699; font-weight: bold;">$nextpage</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$echo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Helper function for pagination which builds the page links.
 *
 * @access private
 *
 * @author Eric Martin &lt;eric@ericmmartin.com&gt;
 * @copyright Copyright (c) 2009, Eric Martin
 * @version 1.0
 *
 * @param int $start The first link page.
 * @param int $max The last link page.
 * @return int $page Optional, default is 0. The current page.
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> emm_paginate_loop<span style="color: #009900;">&#40;</span><span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$start</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$max</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">===</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
			? <span style="color: #0000ff;">&quot;&lt;span class='emm-page emm-current'&gt;<span style="color: #006699; font-weight: bold;">$i</span>&lt;/span&gt;&quot;</span> 
			<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_pagenum_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' class='emm-page'&gt;<span style="color: #006699; font-weight: bold;">$i</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>用法是将上面的这些代码添加到主题的functions.php文件中合适位置，然后在主题index.php文件中的合适位置添加以下代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;emm_paginate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> emm_paginate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>如果还想美化一下显示效果的话，可以参考我博客主题的CSS代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.emm-paginate</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">7px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-title</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#555</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-gap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#A91B33</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.emm-paginate</span> a<span style="color: #3333ff;">:active</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-current</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#A91B33</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#A91B33</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">7px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-page</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-prev</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.emm-paginate</span> <span style="color: #6666ff;">.emm-next</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="不用插件实现wordpress分页导航的方法" href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/">http://chenzhiwei.net/2010/12/display-pagination-without-plugin/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2009/11/several-html-online-editor/" title="几款不错的在线HTML编辑器">几款不错的在线HTML编辑器</a></li><li><a href="http://chenzhiwei.net/2009/11/move-blog-again/" title="博客又一次搬家">博客又一次搬家</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/12/display-pagination-without-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>wordpress主题常用的代码</title>
		<link>http://chenzhiwei.net/2010/07/wordpress-useful-code/</link>
		<comments>http://chenzhiwei.net/2010/07/wordpress-useful-code/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 09:54:49 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[默认分类]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://chenzhiwei.net/?p=30304</guid>
		<description><![CDATA[很多同学的wordpress博客主题侧边栏都有最新文章、随机文章、最新评论等等内容，而单篇文章下方也会加上版权信息，我之前添加版权信息就是在写每篇文章时，在最后加上，但是这样太麻烦，自己在网上搜索一下，然后又仿照一些知名博客的相应设置自己也在博客文章页面加上了版权信息，由于最近比较忙，一直没空写出来，今天就把它写出来与大家分享一下。 1. 最新/随机文章 1 2 3 4 5 6 7 global $post; $myposts = get_posts('numberposts=9&#38;offset=1&#38;orderby=rand'); foreach($myposts as $post) : setup_postdata($post); ?&#62; &#60;li&#62;&#60;a href=&#34;&#60;?php the_permalink&#40;&#41;; ?&#62;&#34; title=&#34;&#60;?php the_title&#40;&#41;; ?&#62;&#34;&#62;&#60;?php the_title&#40;&#41;; ?&#62;&#60;/a&#62;&#60;/li&#62; &#60;?php endforeach; 最新/随机文章用的是wordpress现成的函数调用，上述代码中的numberposts=9是指显示9篇文章，orderby=rand意思是随机显示，如果是orderby=date就是最新文章了，当然还得order=desc，意思是按日期降序排列，懂sql语言的同学很容易就能看明白，这里有更详细的官方介绍，不过是英文的。这个地方是获得最新文章的另一种方法。 2. 最新评论 1 2 3 4 5 6 7 $comments = get_comments('number=9&#38;$status=approve&#38;offset=1'); foreach($comments as $comm) : $comm-&#62;comment_content=mb_substr($comm-&#62;comment_content,0,20); ?&#62; &#60;li&#62;&#60;a href=&#34;&#60;?php echo&#40;get_permalink&#40;$comm-&#62;comment_post_ID&#41;&#41;; ?&#62;#comment-&#60;?php [...]]]></description>
			<content:encoded><![CDATA[<p>很多同学的wordpress博客主题侧边栏都有最新文章、随机文章、最新评论等等内容，而单篇文章下方也会加上版权信息，我之前添加版权信息就是在写每篇文章时，在最后加上，但是这样太麻烦，自己在网上搜索一下，然后又仿照一些知名博客的相应设置自己也在博客文章页面加上了版权信息，由于最近比较忙，一直没空写出来，今天就把它写出来与大家分享一下。<br />
<span id="more-30304"></span><br />
<strong>1. 最新/随机文章</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">global $post;
	 $myposts = get_posts('numberposts=9&amp;offset=1&amp;orderby=rand');
	 foreach($myposts as $post) :
	   setup_postdata($post);
	 ?&gt;
		&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/li&gt;
	 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>最新/随机文章用的是wordpress现成的函数调用，上述代码中的numberposts=9是指显示9篇文章，orderby=rand意思是随机显示，如果是orderby=date就是最新文章了，当然还得order=desc，意思是按日期降序排列，懂sql语言的同学很容易就能看明白，<a href="http://codex.wordpress.org/Function_Reference/get_posts" target="_blank">这里</a>有更详细的官方介绍，不过是英文的。这个<a href="http://codex.wordpress.org/Function_Reference/wp_get_recent_posts" target="_blank">地方</a>是获得最新文章的另一种方法。</p>
<p><strong>2. 最新评论</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">$comments = get_comments('number=9&amp;$status=approve&amp;offset=1');
		  foreach($comments as $comm) :
			$comm-&gt;comment_content=mb_substr($comm-&gt;comment_content,0,20);
		?&gt;
		  &lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comm</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_post_ID</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>#comment-<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comm</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;view the entire comment by <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comm</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comm</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/li&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
		  <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>最新评论这个代码用了我很长时间才写好，一般网上的方法都是直接去查询数据库，写一大堆代码，太麻烦了，我在<a href="http://codex.wordpress.org/Function_Reference/get_comments" target="_blank">wordpress官方文档</a>上找到了这个方法，很好用，不过总是最后一条评论显示不出来，目前也没有找到原因。代码说明我就不写了，很简单的。</p>
<p><strong>3. 版权信息</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> insertNote<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span>is_feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$content</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&lt;p style=&quot;font-weight: bold;&quot;&gt;&amp;copy; '</span><span style="color: #339933;">.</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', &lt;a href=&quot;http://chenzhiwei.net&quot;&gt;chenzhiwei.net&lt;/a&gt;. 版权所有.  &lt;br /&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$content</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$content</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">'本文永久链接：&lt;a title=&quot;'</span><span style="color: #339933;">.</span>get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$content</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;hr /&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'insertNote'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>版权信息是在主题支持函数里写一个函数，就可以了。也可以将feed里也加入版权信息。以上代码就是我博客里的用，可以参考一下。相关图片如下：</p>
<p><img class="alignnone" title="feed 版权信息" src="http://farm5.static.flickr.com/4119/4811292687_0da7d9b079_b.jpg" alt="single" width="590" height="280" /></p>
<p><img class="alignnone" title="single page 版权信息" src="http://farm5.static.flickr.com/4122/4811292695_8c31c8ac67_b.jpg" alt="single" width="563" height="145" /></p>
<p><strong>4. 存档页面</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;archive&quot;&gt;
&nbsp;
	&lt;strong&gt;by page:&lt;/strong&gt;
		&lt;ul&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/ul&gt;
&nbsp;
	&lt;strong&gt;by month:&lt;/strong&gt;
		&lt;ul&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_get_archives<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type=monthly'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/ul&gt;
&nbsp;
	&lt;strong&gt;by category:&lt;/strong&gt;
		&lt;ul&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sort_column=name&amp;title_li='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/ul&gt;
&nbsp;
&lt;/div&gt;
&nbsp;
&lt;div class=&quot;archive&quot;&gt;
&nbsp;
	&lt;strong&gt;by post:&lt;/strong&gt;
		&lt;ul&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_get_archives<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type=postbypost&amp;limit=100'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
		&lt;/ul&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>有些同学一直在用插件实现文档存档，不过，我认为博客里最好还是少用插件，这样可以减轻服务器负担，也减少了升级插件的麻烦，下面就是我存档页面用的代码。</p>
<p>以上就是我博客里用到的一些代码，以后再用其他代码时，我会及时补充上来。</p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="wordpress主题常用的代码" href="http://chenzhiwei.net/2010/07/wordpress-useful-code/">http://chenzhiwei.net/2010/07/wordpress-useful-code/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2009/11/move-blog-again/" title="博客又一次搬家">博客又一次搬家</a></li><li><a href="http://chenzhiwei.net/2009/04/cannot-modify-header-information/" title="Cannot modify header information的问题">Cannot modify header information的问题</a></li><li><a href="http://chenzhiwei.net/2011/11/old-version-php-support-json/" title="让旧版本的PHP支持json">让旧版本的PHP支持json</a></li><li><a href="http://chenzhiwei.net/2011/10/write-write/" title="随写">随写</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/07/wordpress-useful-code/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>博客更换主题</title>
		<link>http://chenzhiwei.net/2010/02/change-blog-theme/</link>
		<comments>http://chenzhiwei.net/2010/02/change-blog-theme/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:52:51 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=30149</guid>
		<description><![CDATA[在放假前我紧张的将studiopress.com的church主题修改了一下就换上了，感觉这个主题很不错，整洁不失个性。我就喜欢这样的主题。 我去掉了主题上自带的首页，自己又制作了个博客页面外加一个single页面，总体上对自己的修改还算满意。该主题使用了三个插件：相关文章、分页插件和语法高亮插件。我觉得相关文章和分页插件不管在哪个主题里都是必不可少的，这是来实现一个博客的基本功能，而语法高亮插件对于普通博客是不必要的。 主题边栏全为自定义代码，哪天有时间了我会专门写一篇文章来介绍我博客上的插件的以及主题边栏自定义代码。 我比较喜欢这种整齐简洁的主题，于是自己断断续续花了很长时间才改成现在的样子，自我感觉很满意。 主题下载地址： http://themes.wopus.org/themes/english-lanuage/1062.html &#169; 2010, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2010/02/change-blog-theme/相关日志不用插件实现wordpress分页导航的方法博客最近的更新wordpress主题常用的代码几款不错的在线HTML编辑器博客又一次搬家]]></description>
			<content:encoded><![CDATA[<p>在放假前我紧张的将studiopress.com的church主题修改了一下就换上了，感觉这个主题很不错，整洁不失个性。我就喜欢这样的主题。</p>
<p>我去掉了主题上自带的首页，自己又制作了个博客页面外加一个single页面，总体上对自己的修改还算满意。该主题使用了三个插件：相关文章、分页插件和语法高亮插件。我觉得相关文章和分页插件不管在哪个主题里都是必不可少的，这是来实现一个博客的基本功能，而语法高亮插件对于普通博客是不必要的。<span id="more-30149"></span></p>
<p>主题边栏全为自定义代码，哪天有时间了我会专门写一篇文章来介绍我博客上的插件的以及主题边栏自定义代码。</p>
<p>我比较喜欢这种整齐简洁的主题，于是自己断断续续花了很长时间才改成现在的样子，自我感觉很满意。</p>
<p>主题下载地址： <a href="http://themes.wopus.org/themes/english-lanuage/1062.html" target="_blank">http://themes.wopus.org/themes/english-lanuage/1062.html</a></p>
<p style="font-weight: bold;">&copy; 2010, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="博客更换主题" href="http://chenzhiwei.net/2010/02/change-blog-theme/">http://chenzhiwei.net/2010/02/change-blog-theme/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2009/11/several-html-online-editor/" title="几款不错的在线HTML编辑器">几款不错的在线HTML编辑器</a></li><li><a href="http://chenzhiwei.net/2009/11/move-blog-again/" title="博客又一次搬家">博客又一次搬家</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2010/02/change-blog-theme/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>几款不错的在线HTML编辑器</title>
		<link>http://chenzhiwei.net/2009/11/several-html-online-editor/</link>
		<comments>http://chenzhiwei.net/2009/11/several-html-online-editor/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 11:09:56 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[ewebeditor]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=30113</guid>
		<description><![CDATA[这几天在做一个项目，要用到文本编辑，于是就在网上收集了一下HTML文本编辑器，这东西感觉以后还会常用到，所以自己就在博客里写下这篇文章。 1.ewebeditor 官方网站：http://www.ewebeditor.net/ 先看官方的介绍：eWebEditor是基于浏览器的、所见即所得的在线HTML编辑器。她能够在网页上实现许多桌面编辑软件（如：Word）所具有的强大可视编辑功能。 WEB开发人员可以用她把传统的多行文本输入框&#60;TEXTAREA&#62;替换为可视化的富文本输入框，使最终用户可以可视化的发布HTML格式的 网页内容。eWebEditor!已基本成为网站内容管理发布的必备工具！ 自我感觉这个在线网页编辑器总体上还可以，并且还有自己的管理后台，皮肤也都很漂亮。但是某些版本的好像是IEonly，这个有点让人受不了。 2.xheditor 官方网站：http://code.google.com/p/xheditor/ 官方介绍：xhEditor是一个基于jQuery开发的简单迷你并且高效的可视化XHTML编辑器，基于网络访问并且兼容IE 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22。 我个人比较喜欢使用这个在线网页编辑器，现在这个编辑器也有一个不小的用户群了。 3.淘宝开源编辑器 官方网站：http://code.google.com/p/kissy/ 官方介绍：Something that is enjoyable gives you pleasure. 理念：小巧灵活，简洁实用，使用起来让人感觉愉悦。 对于这个编辑器，我有一个疑问，不知道它什么要叫淘宝开源编辑器，这与淘宝有什么关系？可能是和淘宝网的编辑器相似吧。不管他了，反正好用就行。现在还有没有使用过这个编辑器，不过在twitter里有很多人都RT了这个编辑器，过两天我会试用一遍的。 4.TinyMCE 官方网站：http://tinymce.moxiecode.com/ 关于这个编辑器，我想各位同学应该不会陌生吧，这就是大名顶顶的PHP博客wordpress所用的编辑器，这个编辑器是相当的强大，wordpress里面只是一个简化版的。虽然这个编辑器我用着不太习惯但是它的确不错，所以还是要在这里推荐下。 另外：我还有一个ASP的简单HTML在线编辑器，感觉还不错，是一个网友给我的，我不知道名字，所以就不在这里说了，感觉兴趣的同学可以给我发邮件。 PS：还有很多在线网页编辑器，我就不再多说了，以前我也在网上搜集了很多，不过感觉这几款不错，有更好的了，我还会继续添加上去的。 &#169; 2009, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2009/11/several-html-online-editor/相关日志博客最近的更新不用插件实现wordpress分页导航的方法wordpress主题常用的代码博客更换主题博客又一次搬家]]></description>
			<content:encoded><![CDATA[<p>这几天在做一个项目，要用到文本编辑，于是就在网上收集了一下HTML文本编辑器，这东西感觉以后还会常用到，所以自己就在博客里写下这篇文章。</p>
<p><strong>1.ewebeditor</strong><br />
官方网站：http://www.ewebeditor.net/<br />
先看官方的介绍：eWebEditor是基于浏览器的、所见即所得的在线HTML编辑器。她能够在网页上实现许多桌面编辑软件（如：Word）所具有的强大可视编辑功能。 WEB开发人员可以用她把传统的多行文本输入框&lt;TEXTAREA&gt;替换为可视化的富文本输入框，使最终用户可以可视化的发布HTML格式的 网页内容。eWebEditor!已基本成为网站内容管理发布的必备工具！<br />
自我感觉这个在线网页编辑器总体上还可以，并且还有自己的管理后台，皮肤也都很漂亮。但是某些版本的好像是IEonly，这个有点让人受不了。<span id="more-30113"></span></p>
<p><strong>2.<a style="text-decoration: none; color: #000000;" href="http://code.google.com/p/xheditor/">xheditor</a></strong><br />
官方网站：http://code.google.com/p/xheditor/<br />
官方介绍：xhEditor是一个基于jQuery开发的简单迷你并且高效的可视化XHTML编辑器，基于网络访问并且兼容IE 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22。<br />
我个人比较喜欢使用这个在线网页编辑器，现在这个编辑器也有一个不小的用户群了。</p>
<p><strong>3.淘宝开源编辑器</strong><br />
官方网站：http://code.google.com/p/kissy/<br />
官方介绍：Something that is enjoyable gives you pleasure.<br />
理念：小巧灵活，简洁实用，使用起来让人感觉愉悦。<br />
对于这个编辑器，我有一个疑问，不知道它什么要叫淘宝开源编辑器，这与淘宝有什么关系？可能是和淘宝网的编辑器相似吧。不管他了，反正好用就行。现在还有没有使用过这个编辑器，不过在twitter里有很多人都RT了这个编辑器，过两天我会试用一遍的。</p>
<p><strong>4.TinyMCE</strong><br />
官方网站：http://tinymce.moxiecode.com/<br />
关于这个编辑器，我想各位同学应该不会陌生吧，这就是大名顶顶的PHP博客wordpress所用的编辑器，这个编辑器是相当的强大，wordpress里面只是一个简化版的。虽然这个编辑器我用着不太习惯但是它的确不错，所以还是要在这里推荐下。</p>
<p>另外：我还有一个ASP的简单HTML在线编辑器，感觉还不错，是一个网友给我的，我不知道名字，所以就不在这里说了，感觉兴趣的同学可以给我发邮件。<br />
PS：还有很多在线网页编辑器，我就不再多说了，以前我也在网上搜集了很多，不过感觉这几款不错，有更好的了，我还会继续添加上去的。</p>
<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="几款不错的在线HTML编辑器" href="http://chenzhiwei.net/2009/11/several-html-online-editor/">http://chenzhiwei.net/2009/11/several-html-online-editor/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li><li><a href="http://chenzhiwei.net/2009/11/move-blog-again/" title="博客又一次搬家">博客又一次搬家</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/11/several-html-online-editor/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>博客又一次搬家</title>
		<link>http://chenzhiwei.net/2009/11/move-blog-again/</link>
		<comments>http://chenzhiwei.net/2009/11/move-blog-again/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 04:47:24 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[个人日志]]></category>
		<category><![CDATA[建站相关]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=30091</guid>
		<description><![CDATA[真有点受不了现在的网络环境了，网络管制太强了，一些优秀的国外互联网应用在国内总是不能使用。前几天google的ghs的IP地址又被墙了，直到现在也没有发现一个可用的IP，无奈，只好将博客转移到wordpress下了，真有点舍不得micolog，一个很不错的搭建在GAE上的用python写的博客程序。换了一个黑色主调的主题，感觉很不错。主题自带了个友情链接页面，我把所有的友情链接都转移到了页面上去，而在边栏是看不到友情链接了，有点遗憾。 今天我一共整理了一上午，终于把去年写过的博客与今年写过的博客整合到一起了，用的是wordpress程序，在整理过程中我发现我的互联网生活还挺丰富的，从2008年十月份开始独立博客后，一直都在写博客，虽然写的文章不多，但是我很少间断过。以前写博客都是乱写，不知道该写什么，并且我还弄了N多个博客，几乎到处都能看到我写的东西。昨天和Qinger聊了一会，他建议我好好的写一个博客，我现在也发现自己根本没有那么多的精力去写多个博客。现在我准备重新启用这个博客了，把博客文章链接重新整理了一下，用“域名/年份/月份/博客名”来统一博客链接，不管搜索引擎了。 刚开始我的博客在子域名blog.chenzhiwei.cn下，后来发现百度联盟不能用子域名来申请，于是我就将博客转移到了主域名下，但是我申请了N次百度联盟，始终没能申请下来，现在我已经对百度联盟不抱希望了，当时申请google adsense时，非常容易，我开通了一个blogger，然后用这个blogger申请，两天后就成功了。google adsense容易申请不假，但是挣钱是超难，我以前作弊过，也弄了几美元，可现在我不敢了，害怕辛辛苦苦挣的几刀再被google给收回，那样就得不偿失了。 写博客是一种享受，相信很多同学都是这么认为的吧。等到自己实在无聊时，还能看看自己以前写的文章，找找当时那种写文章的感觉，这也算是一种排解烦恼的方法吧。不管以后怎样，我相信我会继续将博客写下去的。 &#169; 2009, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2009/11/move-blog-again/相关日志博客最近的更新wordpress主题常用的代码随写提前祝博客访客及博友们新年快乐不用插件实现wordpress分页导航的方法]]></description>
			<content:encoded><![CDATA[<p>真有点受不了现在的网络环境了，网络管制太强了，一些优秀的国外互联网应用在国内总是不能使用。前几天google的ghs的IP地址又被墙了，直到现在也没有发现一个可用的IP，无奈，只好将博客转移到wordpress下了，真有点舍不得micolog，一个很不错的搭建在GAE上的用python写的博客程序。换了一个黑色主调的主题，感觉很不错。主题自带了个友情链接页面，我把所有的友情链接都转移到了页面上去，而在边栏是看不到友情链接了，有点遗憾。<span id="more-30091"></span></p>
<p>今天我一共整理了一上午，终于把去年写过的博客与今年写过的博客整合到一起了，用的是wordpress程序，在整理过程中我发现我的互联网生活还挺丰富的，从2008年十月份开始独立博客后，一直都在写博客，虽然写的文章不多，但是我很少间断过。以前写博客都是乱写，不知道该写什么，并且我还弄了N多个博客，几乎到处都能看到我写的东西。昨天和Qinger聊了一会，他建议我好好的写一个博客，我现在也发现自己根本没有那么多的精力去写多个博客。现在我准备重新启用这个博客了，把博客文章链接重新整理了一下，用“域名/年份/月份/博客名”来统一博客链接，不管搜索引擎了。</p>
<p>刚开始我的博客在子域名blog.chenzhiwei.cn下，后来发现百度联盟不能用子域名来申请，于是我就将博客转移到了主域名下，但是我申请了N次百度联盟，始终没能申请下来，现在我已经对百度联盟不抱希望了，当时申请google adsense时，非常容易，我开通了一个blogger，然后用这个blogger申请，两天后就成功了。google adsense容易申请不假，但是挣钱是超难，我以前作弊过，也弄了几美元，可现在我不敢了，害怕辛辛苦苦挣的几刀再被google给收回，那样就得不偿失了。</p>
<p>写博客是一种享受，相信很多同学都是这么认为的吧。等到自己实在无聊时，还能看看自己以前写的文章，找找当时那种写文章的感觉，这也算是一种排解烦恼的方法吧。不管以后怎样，我相信我会继续将博客写下去的。</p>
<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="博客又一次搬家" href="http://chenzhiwei.net/2009/11/move-blog-again/">http://chenzhiwei.net/2009/11/move-blog-again/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2011/10/write-write/" title="随写">随写</a></li><li><a href="http://chenzhiwei.net/2011/01/happy-spring-festival-2011/" title="提前祝博客访客及博友们新年快乐">提前祝博客访客及博友们新年快乐</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/11/move-blog-again/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>wordpress的评论邮件回复功能</title>
		<link>http://chenzhiwei.net/2009/04/wordpress-comments-reply/</link>
		<comments>http://chenzhiwei.net/2009/04/wordpress-comments-reply/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:09:04 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[默认分类]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=222</guid>
		<description><![CDATA[相信现在很多人都在使用wordpress的那个评论回复的插件（WP Thread Comment）吧，其中有个功能是当评论者的评论被人回复后可以邮件通知，通知的电子邮件地址一般都是 no-reply@博客地址，很不够个性，我今天看了下这个插件的代码，发现这个发件人地址是可以更改的，并且可以改成任意你想要的发件人地址，具体做法请看下段文字。顺便说一下，邮件发件人的地址并不是真正的发件人地址，真正的发件人地址在信头文件里，所以以后看到一些邮件，并且地址是自己熟悉的带有欺骗性质的邮件一定要看一下信头文件，看看是不是真实的邮件。 编辑WP Thread Comment 插件的代码，找到这一行代码， $wp_email = &#8216;no-reply@&#8217; . preg_replace(&#8216;#^www\.#&#8217;, ”,  strtolower($_SERVER['SERVER_NAME'])); 然后将这一行代码做以下修改，$wp_email = &#8216;*@XX.com&#8217;; 其中 *@XX.com 就是你想要的发件人地址。改好后自己测试一下吧。 update: 更新一下，新版的wordpress后台已经有嵌套评论了(wordpress后台-&#62;设置-&#62;讨论-&#62;其他评论设置-&#62;允许嵌套N条评论)，所以这个thread comment插件一般也就用不上了，可以使用comment-reply-notification这个插件来代替，安装这个插件并激活后可以到wordpress后台设置那里来对该插件做详细设置。具体设置方法可以参考插件页面。另外，自定义邮箱地址在我的主机上不能使用。 update20101210：现在已经可以不用插件来实现评论邮件回复了。我已经使用半年了，感觉很不错，将以下代码贴到主题的functions.php文件中的合适位置即可实现评论邮件回复功能。这样一来，你的wordpress博客就可以少用一个插件了。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 /* comment_mail_notify v1.0 by [...]]]></description>
			<content:encoded><![CDATA[<p>相信现在很多人都在使用wordpress的那个评论回复的插件（WP Thread Comment）吧，其中有个功能是当评论者的评论被人回复后可以邮件通知，通知的电子邮件地址一般都是 no-reply@博客地址，很不够个性，我今天看了下这个插件的代码，发现这个发件人地址是可以更改的，并且可以改成任意你想要的发件人地址，具体做法请看下段文字。顺便说一下，邮件发件人的地址并不是真正的发件人地址，真正的发件人地址在信头文件里，所以以后看到一些邮件，并且地址是自己熟悉的带有欺骗性质的邮件一定要看一下信头文件，看看是不是真实的邮件。<span id="more-222"></span><br />
编辑WP Thread Comment 插件的代码，找到这一行代码，<br />
$wp_email = &#8216;no-reply@&#8217; . preg_replace(&#8216;#^www\.#&#8217;, ”,  strtolower($_SERVER['SERVER_NAME']));<br />
然后将这一行代码做以下修改，$wp_email = &#8216;*@XX.com&#8217;; 其中 *@XX.com 就是你想要的发件人地址。改好后自己测试一下吧。</p>
<p>update: 更新一下，新版的wordpress后台已经有嵌套评论了(wordpress后台-&gt;设置-&gt;讨论-&gt;其他评论设置-&gt;允许嵌套N条评论)，所以这个thread comment插件一般也就用不上了，可以使用<a href="http://fairyfish.net/2008/11/03/comment-reply-notification/" target="_blank">comment-reply-notification</a>这个插件来代替，安装这个插件并激活后可以到wordpress后台设置那里来对该插件做详细设置。具体设置方法可以参考<a href="http://fairyfish.net/2008/11/03/comment-reply-notification/" target="_blank">插件页面</a>。另外，自定义邮箱地址在我的主机上不能使用。</p>
<p>update20101210：现在已经可以不用插件来实现评论邮件回复了。我已经使用半年了，感觉很不错，将以下代码贴到主题的functions.php文件中的合适位置即可实现评论邮件回复功能。这样一来，你的wordpress博客就可以少用一个插件了。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* comment_mail_notify v1.0 by willin kan. (reply all comments) */</span>
<span style="color: #000000; font-weight: bold;">function</span> comment_mail_notify<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> get_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$parent_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_parent</span> ? <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_parent</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$spam_confirmed</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_approved</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parent_id</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$spam_confirmed</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'spam'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$wp_email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wordpress@'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#^www\.#'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//from email address</span>
    <span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span>get_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parent_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author_email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//to email address</span>
    <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'您在 ['</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;blogname&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'] 的留言有了回应'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'
    &lt;div style=&quot;background-color:#eef2fa; border:1px solid #d8e3e8; color:#111; padding:0 15px; -moz-border-radius:5px; -webkit-border-radius:5px; -khtml-border-radius:5px;&quot;&gt;
      &lt;p&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span>get_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parent_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">', 您好!&lt;/p&gt;
      &lt;p&gt;您曾在《'</span> <span style="color: #339933;">.</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_post_ID</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'》的留言:&lt;br /&gt;&lt;b&gt;'</span>
       <span style="color: #339933;">.</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span>get_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parent_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/b&gt;&lt;/p&gt;
      &lt;p&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' 给您的回应:&lt;br /&gt;&lt;b&gt;'</span>
       <span style="color: #339933;">.</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;
      &lt;p&gt;您可以点击 &lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span>get_comment_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$parent_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;查看回应完整內容&lt;/a&gt;&lt;/p&gt;
      &lt;p&gt;欢迎再次访问 &lt;a href=&quot;'</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;&lt;b&gt;'</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blogname'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
      &lt;p&gt;&lt;b&gt;注：此邮件由系统发出，但您的回复将发送至我的收件箱。&lt;/b&gt;&lt;/p&gt;
    &lt;/div&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blogname'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> &lt;<span style="color: #006699; font-weight: bold;">$wp_email</span>&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$from</span><span style="color: #000099; font-weight: bold;">\n</span>Content-Type: text/html; charset=&quot;</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blog_charset'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    wp_mail<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'comment_mail_notify'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="wordpress的评论邮件回复功能" href="http://chenzhiwei.net/2009/04/wordpress-comments-reply/">http://chenzhiwei.net/2009/04/wordpress-comments-reply/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2010/04/recommend-to-use-firefox-web-browser/" title="推荐使用火狐浏览器">推荐使用火狐浏览器</a></li><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/04/wordpress-comments-reply/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>我的垃圾评论太多了，Akismet还须要加油呀</title>
		<link>http://chenzhiwei.net/2009/04/akismet-and-comments/</link>
		<comments>http://chenzhiwei.net/2009/04/akismet-and-comments/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:42:06 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[默认分类]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[垃圾评论]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=209</guid>
		<description><![CDATA[最近也不知道怎么了，垃圾评论N多N多的，让我删了又删，虽然Akismet能够过滤，但是得等到一个月后才能删除，而一个月后我的MySQL数据库可能就没有空间了。我看到过很多博客的评论那里都有让填写验证码或数学小运算，虽然这样能过滤一些垃圾评论，但我不太喜欢这样做，给一个人评论一下不应该这么麻烦的。 太无奈了，面对这么多垃圾评论到底该怎么做呀。垃圾评论的IP段就是这两个：194.8.74.*和194.8.75.* ，大家都把这两个IP段给屏蔽了吧。有好的方法来删除这些评论了别忘了给俺说一声。 &#169; 2009, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2009/04/akismet-and-comments/相关日志博客最近的更新不用插件实现wordpress分页导航的方法wordpress主题常用的代码博客更换主题几款不错的在线HTML编辑器]]></description>
			<content:encoded><![CDATA[<p>最近也不知道怎么了，垃圾评论N多N多的，让我删了又删，虽然Akismet能够过滤，但是得等到一个月后才能删除，而一个月后我的MySQL数据库可能就没有空间了。我看到过很多博客的评论那里都有让填写验证码或数学小运算，虽然这样能过滤一些垃圾评论，但我不太喜欢这样做，给一个人评论一下不应该这么麻烦的。<span id="more-209"></span></p>
<p>太无奈了，面对这么多垃圾评论到底该怎么做呀。垃圾评论的IP段就是这两个：194.8.74.*和194.8.75.* ，大家都把这两个IP段给屏蔽了吧。有好的方法来删除这些评论了别忘了给俺说一声。</p>
<p><img class="alignnone" title="akismet-1" src="http://farm4.static.flickr.com/3298/3425327874_1d6b66da03_o.jpg" alt="" width="441" height="57" /><br />
<img class="alignnone" src="http://farm4.static.flickr.com/3636/3425327918_387b6a3a67_o.jpg" alt="" width="580" height="730" /></p>
<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="我的垃圾评论太多了，Akismet还须要加油呀" href="http://chenzhiwei.net/2009/04/akismet-and-comments/">http://chenzhiwei.net/2009/04/akismet-and-comments/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li><li><a href="http://chenzhiwei.net/2009/11/several-html-online-editor/" title="几款不错的在线HTML编辑器">几款不错的在线HTML编辑器</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/04/akismet-and-comments/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Cannot modify header information的问题</title>
		<link>http://chenzhiwei.net/2009/04/cannot-modify-header-information/</link>
		<comments>http://chenzhiwei.net/2009/04/cannot-modify-header-information/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 00:08:10 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[字符编码]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=201</guid>
		<description><![CDATA[今天安装wordpress遇到了一个问题，相信 很多朋友在安装wordpress应用程序或其他PHP应用程序时也遇到过这样的问题：Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/wp-config.php:1) in /home/xxx/public_html/wp-includes/pluggable.php on line 7 ，我安装过两次，都遇到了这样的问题。 第一次是安装好之后要修改conifg.php里面的数据连接问题，结果出现了这个提示。还有一次是在安装时出现了这个提示，我在网上找了很长时间，最终发现在一篇文章里看到了解决办法。 其实大部分网友使用的编辑器，可能都是 Windows 操作系统所自带的记事本程序（Notepad.exe），而这个程序所支持的编码格式只有 ANSI, Unicode big endian, Unicode 和UTF8 四种。因此，当修改为 wp-config-sample.php 文件（这里以wordpress配置文件为例），另存为 wp-config.php 文件的时候，原本的 UTF8 no BOM(Byte Order Mark) 格式，就是自动保存为 UTF8 ( with BOM )格式。记事本给文件自动添加 BOM （字节顺序标志），因此 wp-config.php 第一行就多出了一个 php 无法识别的标志，因此也就带来了上述的困扰。 解决办法就是在自己电脑上打开该文件，然后另存为ANSI编码格式。当然，你电脑上如果有能区别UTF8 no [...]]]></description>
			<content:encoded><![CDATA[<p>今天安装wordpress遇到了一个问题，相信 很多朋友在安装wordpress应用程序或其他PHP应用程序时也遇到过这样的问题：<code>Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/wp-config.php:1) in /home/xxx/public_html/wp-includes/pluggable.php on line 7 </code>，我安装过两次，都遇到了这样的问题。<span id="more-201"></span></p>
<p>第一次是安装好之后要修改conifg.php里面的数据连接问题，结果出现了这个提示。还有一次是在安装时出现了这个提示，我在网上找了很长时间，最终发现在一篇文章里看到了解决办法。</p>
<p>其实大部分网友使用的编辑器，可能都是 Windows 操作系统所自带的记事本程序（Notepad.exe），而这个程序所支持的编码格式只有 ANSI, Unicode big endian, Unicode 和UTF8 四种。因此，当修改为 wp-config-sample.php 文件（这里以wordpress配置文件为例），另存为 wp-config.php 文件的时候，原本的 UTF8 no BOM(Byte Order Mark) 格式，就是自动保存为 UTF8 ( with BOM )格式。记事本给文件自动添加 BOM （字节顺序标志），因此 wp-config.php 第一行就多出了一个 php 无法识别的标志，因此也就带来了上述的困扰。</p>
<p>解决办法就是在自己电脑上打开该文件，然后另存为ANSI编码格式。当然，你电脑上如果有能区别UTF8 no BOM与UTF8 with BOM 编辑器的话，你也可以把文件存为UTF8 no BOM格式，这样就不会再出现那个warning了，一切都搞定了。</p>
<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="Cannot modify header information的问题" href="http://chenzhiwei.net/2009/04/cannot-modify-header-information/">http://chenzhiwei.net/2009/04/cannot-modify-header-information/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2011/11/old-version-php-support-json/" title="让旧版本的PHP支持json">让旧版本的PHP支持json</a></li><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/04/cannot-modify-header-information/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>我的wordpess主题又作了几处改动</title>
		<link>http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/</link>
		<comments>http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 01:21:06 +0000</pubDate>
		<dc:creator>zhiwei</dc:creator>
				<category><![CDATA[建站相关]]></category>
		<category><![CDATA[默认分类]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[主题]]></category>

		<guid isPermaLink="false">http://blog.chenzhiwei.cn/?p=140</guid>
		<description><![CDATA[        今天本来要给别人做网站，可由于对方FTP没开，自己又不知如何下手，又看了看网页设计的书，就索性将我的博客主题修改了一下。原来的评论界面不够美观，现在通过CSS的改动，已经基本符合我意。首页图片又进一步减少，打开速度比以往更快。主界面调至980px，比以前较为整齐，右边两栏相比以前较为紧缩。link页面与archive页面做了一些简单改动，看起来更加漂亮大方。         这次改动我分别在IE6.0，Firefox，sogouExplorer下测试通过。另又分别在分辨率为1024*768和1600*1200的屏幕下显示正常。喜欢我这个主题的小同学可以给我发送电子邮件索要，我定当双手奉上。今天比较忙，就写这么多吧。 &#169; 2009, chenzhiwei.net. 版权所有. 本文永久链接：http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/相关日志博客最近的更新不用插件实现wordpress分页导航的方法wordpress主题常用的代码博客更换主题几款不错的在线HTML编辑器]]></description>
			<content:encoded><![CDATA[<p>        今天本来要给别人做网站，可由于对方FTP没开，自己又不知如何下手，又看了看网页设计的书，就索性将我的博客主题修改了一下。原来的评论界面不够美观，现在通过CSS的改动，已经基本符合我意。首页图片又进一步减少，打开速度比以往更快。主界面调至980px，比以前较为整齐，右边两栏相比以前较为紧缩。link页面与archive页面做了一些简单改动，看起来更加漂亮大方。<span id="more-140"></span><br />
        这次改动我分别在IE6.0，Firefox，sogouExplorer下测试通过。另又分别在分辨率为1024*768和1600*1200的屏幕下显示正常。喜欢我这个主题的小同学可以给我发送电子邮件索要，我定当双手奉上。今天比较忙，就写这么多吧。</p>
<p style="font-weight: bold;">&copy; 2009, <a href="http://chenzhiwei.net">chenzhiwei.net</a>. 版权所有.  <br />本文永久链接：<a title="我的wordpess主题又作了几处改动" href="http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/">http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/</a></p><hr /><div  class="related_post_title">相关日志</div><ul class="related_post"><li><a href="http://chenzhiwei.net/2011/01/recently-blog-update/" title="博客最近的更新">博客最近的更新</a></li><li><a href="http://chenzhiwei.net/2010/12/display-pagination-without-plugin/" title="不用插件实现wordpress分页导航的方法">不用插件实现wordpress分页导航的方法</a></li><li><a href="http://chenzhiwei.net/2010/07/wordpress-useful-code/" title="wordpress主题常用的代码">wordpress主题常用的代码</a></li><li><a href="http://chenzhiwei.net/2010/02/change-blog-theme/" title="博客更换主题">博客更换主题</a></li><li><a href="http://chenzhiwei.net/2009/11/several-html-online-editor/" title="几款不错的在线HTML编辑器">几款不错的在线HTML编辑器</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://chenzhiwei.net/2009/03/edit-the-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

