<?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>HopeSun.info &#187; WordPress</title>
	<atom:link href="http://www.hopesun.info/category/wordpress-blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hopesun.info</link>
	<description>Wind&#039;s Little World</description>
	<lastBuildDate>Mon, 06 Feb 2012 09:27:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>修复WordPress数据表</title>
		<link>http://www.hopesun.info/715.html</link>
		<comments>http://www.hopesun.info/715.html#comments</comments>
		<pubDate>Thu, 18 Mar 2010 03:17:17 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=715</guid>
		<description><![CDATA[今天在更新博客时，突然出现了意外，不知何故，WordPress出现问题。打开博客，所有文章显示找不到。 用php mysql查看，发现wp_posts数据表损坏。 看来得修复MYSQL数据表了。办法其实也很简单，进入phpmyadmin点出错的库,然后再选SQL查询语法，输入: repair table wp_posts 运行后就修复好了。不过还是小小的惊吓了下，赶紧给数据库做个备份。]]></description>
			<content:encoded><![CDATA[<p>今天在更新博客时，突然出现了意外，不知何故，WordPress出现问题。打开博客，所有文章显示找不到。<br />
用php mysql查看，发现wp_posts数据表损坏。<br />
看来得修复MYSQL数据表了。办法其实也很简单，进入phpmyadmin点出错的库,然后再选SQL查询语法，输入:</p>
<p>repair table wp_posts</p>
<p>运行后就修复好了。不过还是小小的惊吓了下，赶紧给数据库做个备份。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/715.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>近期主题修改笔记</title>
		<link>http://www.hopesun.info/641.html</link>
		<comments>http://www.hopesun.info/641.html#comments</comments>
		<pubDate>Thu, 29 Oct 2009 12:44:11 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=641</guid>
		<description><![CDATA[１、首页不显示某分类的文章 先看代码（注意去掉&#60;? 和php 之间的空格） &#60;? php $cat_id=-123;//the category ID $limit = get_option(&#8216;posts_per_page&#8217;); $paged = (get_query_var(&#8216;paged&#8217;)) ? get_query_var(&#8216;paged&#8217;) : 1; query_posts(&#8216;cat=&#8217; . $cat_id . &#8216;&#38;showposts=&#8217; . $limit . &#8216;&#38;paged=&#8217; . $paged); $wp_query-&#62;is_archive = true; $wp_query-&#62;is_home = false; ? &#62; 将这段代码放在模板index.php里面的&#60;?  php get_header(); ?&#62;后面&#60;? php if (have_posts()) : ? &#62;的前面的位置段，就可以了。首页就不会显示这个分类下的文章。代码中的$cat_id，它的值是-123，表示的是除开123分类的其他所有分类，当然，这个分类id也是可以叠加的，用逗号隔开。 ２、DIY个性首页文章 目的：首页输出最新一篇文章的全文或&#60; !–more–&#62;标签之前内容，第二篇以及以后内容输出纯摘要。 打开你的index.php或home.php，找到： &#60; ?php if(have_posts()) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>１、首页不显示某分类的文章</strong></p>
<p>先看代码（注意去掉&lt;? 和php 之间的空格）</p>
<blockquote><p>&lt;? php<br />
$cat_id=-123;//the category ID<br />
$limit = get_option(&#8216;posts_per_page&#8217;);<br />
$paged = (get_query_var(&#8216;paged&#8217;)) ? get_query_var(&#8216;paged&#8217;) : 1;<br />
query_posts(&#8216;cat=&#8217; . $cat_id . &#8216;&amp;showposts=&#8217; . $limit . &#8216;&amp;paged=&#8217; . $paged);<br />
$wp_query-&gt;is_archive = true; $wp_query-&gt;is_home = false;<br />
? &gt;</p></blockquote>
<p>将这段代码放在模板index.php里面的&lt;?  php get_header(); ?&gt;后面&lt;? php if (have_posts()) : ? &gt;的前面的位置段，就可以了。首页就不会显示这个分类下的文章。代码中的$cat_id，它的值是-123，表示的是除开123分类的其他所有分类，当然，这个分类id也是可以叠加的，用逗号隔开。</p>
<p><strong>２、DIY个性首页文章<br />
</strong><span id="more-641"></span><br />
目的：首页输出最新一篇文章的全文或&lt; !–more–&gt;标签之前内容，第二篇以及以后内容输出纯摘要。</p>
<p>打开你的index.php或home.php，找到：</p>
<blockquote><p>&lt; ?php if(have_posts()) : while(have_posts()) : the_post(); ? &gt;</p></blockquote>
<p>在这一句的前面加上代码：</p>
<blockquote><p>&lt; ?php $postcnt= 1; ?&gt;</p></blockquote>
<p>然后找到</p>
<p>&lt; ?php the_content(); ?&gt;</p>
<p>把它修改为</p>
<blockquote><p>&lt; ?php if($postcnt== 1) : ?&gt;&lt;BR&gt;&lt; ?php the_content(); ?&gt;&lt;BR&gt;// 这里还可以放一个广告，效果很好的位置.&lt;BR&gt;&lt; ?php else : ?&gt;&lt;BR&gt;&lt; ?php the_excerpt(); ?&gt;&lt;BR&gt;&lt; ?php endif; $postcnt++; ? &gt;</p></blockquote>
<p><strong>3、添加“原生嵌套评论 Ajax 提交”功能</strong></p>
<p>在 header.php 中找到：</p>
<blockquote><p>〈?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?〉</p></blockquote>
<p>修改为：</p>
<blockquote><p>〈?php if ( is_singular() ){ ?&gt;<br />
〈script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js”&gt;〈/script&gt;<br />
〈script type=”text/javascript” src=”〈?php bloginfo(‘template_directory’); ?&gt;/comments-ajax.js”&gt;〈/script&gt;<br />
〈?php } ?&gt;</p></blockquote>
<p>comments-ajax.js 及 comments-ajax.php 放在主题文件夹内。comments-ajax.js 及 comments-ajax.php<a rel="nofollow" href="http://www.hopesun.info/324wp-content/uploads/2009/10/comments-ajax.rar">下载</a></p>
<p><strong>4、获取指定分类下的标签</strong></p>
<p>有时需要获得某分类下的全部tag</p>
<blockquote><p>function get_category_tags($args) {<br />
global $wpdb;<br />
$tags = $wpdb-&gt;get_results<br />
(”<br />
SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link<br />
FROM<br />
wp_posts as p1<br />
LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID<br />
LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id<br />
LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,</p>
<p>wp_posts as p2<br />
LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID<br />
LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id<br />
LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id<br />
WHERE<br />
t1.taxonomy = ‘category’ AND p1.post_status = ‘publish’ AND terms1.term_id IN (”.$args['categories'].”) AND<br />
t2.taxonomy = ‘post_tag’ AND p2.post_status = ‘publish’<br />
AND p1.ID = p2.ID<br />
ORDER by tag_name<br />
“);<br />
$count = 0;<br />
foreach ($tags as $tag) {<br />
$tags[$count]-&gt;tag_link = get_tag_link($tag-&gt;tag_id);<br />
$count++;<br />
}<br />
return $tags;<br />
}</p></blockquote>
<p>在模板中使用这个函数:</p>
<blockquote><p>$args = array(’categories’ =&gt; ‘12,13,14′);<br />
$tags = get_category_tags($args);</p></blockquote>
<p>5、无插件调用最新文章的例表(20代表要调用的文章数)</p>
<blockquote><p>&lt; ?php wp_get_archives(&#8216;type=postbypost&amp;limit=20&#8242;); ? &gt;</p></blockquote>
<p><strong>6、按分类显示每个分类的最新文章</strong></p>
<p>代码如下：（其中的1,3,4,5,6,7是你要显示的分类ID号）</p>
<blockquote><p>&lt;?php $display_categories = array(1,3,4,5,6,7); foreach ($display_categories as $category) { ?&gt;</p>
<p>&lt; div&gt;</p>
<p>&lt; ?php query_posts(&#8220;showposts=5&amp;cat=$category&#8221;); $wp_query-&gt;is_category = false; $wp_query-&gt;is_archive = false; $wp_query-&gt;is_home = true; ? &gt;</p>
<p>&lt;h3&gt;&lt;span&gt;&lt;a href=&#8221;&lt;?php echo get_category_link($category);?&gt;&#8221;&gt;&amp;#187; 查看更多&lt;/a&gt;&lt;/span&gt;&lt; ?php single_cat_title(); ?&gt;&lt;/h3&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt; ?php if (have_posts()) : ?&gt;</p>
<p>&lt; ?php while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;li&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;</p>
<p>&lt; ?php endwhile; ?&gt;</p>
<p>&lt; ?php else : ?&gt;&lt;p&gt;此分类暂无内容&lt;/p&gt;</p>
<p>&lt; ?php endif; ?&gt;</p>
<p>&lt;/ul&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt; ?php } ?&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/641.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>实现WP完美摘要输出&#8212;-我的第一个插件Limit Posts</title>
		<link>http://www.hopesun.info/613.html</link>
		<comments>http://www.hopesun.info/613.html#comments</comments>
		<pubDate>Thu, 22 Oct 2009 13:58:28 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=613</guid>
		<description><![CDATA[这几天修改主题，为打造完美摘要输出，查阅了不少资料。原Limit Posts插件不知何故早已停止更新，而且其输出不能处理中文乱码问题，不是很满意。 别和我说用the_excerpt，the_excerpt只是除掉了文中的html代码。我试过将the_excerpt截断，效率似乎不高。 偶然在一个主题看到了一个函数，大受启发。 将这几个东西结合了一下，演绎出了这个插件，摘要输出非常完美：中文不出现乱码，也可以灵活控制摘要长度，而且效率不错。 用法很简单，下载该插件上传到plugins目录，后台激活，将主题中archive.php（tag.php、index.php或任何打算摘要显示的文件）中the_content() 替换为the_content_limit(&#8221;,TRUE,&#8221;,555)。 其实，你也可以直接修改 wordpress 系统目录下 wp-includes 文件夹里的 feed.php 包含的 the_content_rss 函数，也就是用这个插件的函数the_content_limit取代the_content_rss。 效果演示 插件下载：http://www.hopesun.info/limit-post.rar]]></description>
			<content:encoded><![CDATA[<p>这几天修改主题，为打造完美摘要输出，查阅了不少资料。原Limit Posts插件不知何故早已停止更新，而且其输出不能处理中文乱码问题，不是很满意。<br />
别和我说用the_excerpt，the_excerpt只是除掉了文中的html代码。我试过将the_excerpt截断，效率似乎不高。</p>
<p>偶然在一个主题看到了一个函数，大受启发。</p>
<p>将这几个东西结合了一下，演绎出了这个插件，摘要输出非常完美：中文不出现乱码，也可以灵活控制摘要长度，而且效率不错。</p>
<p>用法很简单，下载该插件上传到plugins目录，后台激活，将主题中archive.php（tag.php、index.php或任何打算摘要显示的文件）中the_content() 替换为the_content_limit(&#8221;,TRUE,&#8221;,555)。</p>
<p>其实，你也可以直接修改 wordpress 系统目录下 wp-includes 文件夹里的 feed.php 包含的 the_content_rss 函数，也就是用这个插件的函数the_content_limit取代the_content_rss。</p>
<p><a href="http://www.hopesun.info/tag/plugin" target="_blank">效果演示</a><br />
<a href="http://www.hopesun.info/limit-post.rar"><img src="http://www.hopesun.info/zip80.png" class="alignleft" alt="" width="80" height="100" /></a><br />
插件下载：<a href="http://www.hopesun.info/limit-post.rar">http://www.hopesun.info/limit-post.rar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/613.html/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>换主机博客搬家</title>
		<link>http://www.hopesun.info/550.html</link>
		<comments>http://www.hopesun.info/550.html#comments</comments>
		<pubDate>Wed, 23 Sep 2009 06:40:11 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Web Building]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=550</guid>
		<description><![CDATA[原来网站一直用的是西部数码的windows主机，支持ASP和PHP，服务不错，也很稳定。后来运行WP，速度不太理想，就开始考虑是不是换一个WORPRESS专业主机。 昨天在WP讨论区里看到优智科技的广告，WordPress主机，FreeBSD系统，北京四线机房，200M送一个CN域名，70元/年，就动了心。在淘宝上购买很顺利，付款后通过QQ和ranyn联系，空间很快就开通了。 西部数码有网上客服系统，你问我答，遇到问题沟通起来很便利，优智科技靠QQ服务，这方面有待改进。 下面说说搏客搬家的过程。 首先在原来空间利用WordPress Database Backup插件将原博客备份下载下来。 第二步，在新空间利用phpadmin将刚才下载下来的数据导入新数据库中。 因为同时更换了域名，所以安装到新空间后，还必须将原博客的有关连接更换才行。看了很多办法，觉得还是在新空间直接运行SQL最方便： UPDATE wp_options SET option_value = replace(option_value, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8216;siteurl&#8217;; UPDATE wp_posts SET guid = replace(guid, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;); UPDATE wp_posts SET post_content = replace(post_content, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;); 至此，搏客更换新域名新空间算完成了。从购买空间到完成博客搬家，半天搞定。 试用一天，感觉速度比原来有明显提升。]]></description>
			<content:encoded><![CDATA[<p>原来网站一直用的是西部数码的windows主机，支持ASP和PHP，服务不错，也很稳定。后来运行WP，速度不太理想，就开始考虑是不是换一个WORPRESS专业主机。</p>
<p><a href="http://www.uzidc.com/wp/" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/09/uzidc.gif" class="alignright size-full wp-image-552" title="uzidc" alt="uzidc" width="600" height="100" /></a><br />
昨天在WP讨论区里看到优智科技的广告，WordPress主机，FreeBSD系统，北京四线机房，200M送一个CN域名，70元/年，就动了心。在淘宝上购买很顺利，付款后通过QQ和ranyn联系，空间很快就开通了。</p>
<p>西部数码有网上客服系统，你问我答，遇到问题沟通起来很便利，优智科技靠QQ服务，这方面有待改进。</p>
<p>下面说说搏客搬家的过程。<br />
<span id="more-550"></span><br />
首先在原来空间利用<a href="http://www.ilfilosofo.com/blog/wp-db-backup" target="_blank">WordPress Database Backup</a>插件将原博客备份下载下来。<br />
第二步，在新空间利用phpadmin将刚才下载下来的数据导入新数据库中。</p>
<p>因为同时更换了域名，所以安装到新空间后，还必须将原博客的有关连接更换才行。看了很多办法，觉得还是在新空间直接运行SQL最方便：</p>
<blockquote><p>UPDATE wp_options SET option_value = replace(option_value, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8216;siteurl&#8217;;</p>
<p>UPDATE wp_posts SET guid = replace(guid, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;);</p>
<p>UPDATE wp_posts SET post_content = replace(post_content, &#8216;原域名&#8217;, &#8216;http://www.hopesun.info&#8217;);</p></blockquote>
<p>至此，搏客更换新域名新空间算完成了。从购买空间到完成博客搬家，半天搞定。</p>
<p>试用一天，感觉速度比原来有明显提升。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/550.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>推荐两款国外WordPress主机</title>
		<link>http://www.hopesun.info/541.html</link>
		<comments>http://www.hopesun.info/541.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 12:30:33 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Web Building]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=541</guid>
		<description><![CDATA[今天偶然在一位国外网友的博客上看到的。下面这两款主机都经过了他本人一年以上的使用，应该比较可靠。 Greengeeks Their management team has over 40 years of experience in providing high quality, affordable web site hosting. It is fully compatible with WordPress with an easy one-click installation. Space: Unlimited                           Free Domain Name Traffic: Unlimited                         Host Unlimited Domains Price: $6.95                                    FREE Site Builder IXwebhosting One of the best WordPress hosting providers. Host multiple [...]]]></description>
			<content:encoded><![CDATA[<p>今天偶然在<a href="http://www.templatelite.com/" target="_blank">一位国外网友的博客</a>上看到的。下面这两款主机都经过了他本人一年以上的使用，应该比较可靠。</p>
<p><a href="http://www.greengeeks.com/" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/09/greengeeks.jpg" class="alignright size-full wp-image-543" title="greengeeks" alt="greengeeks" width="120" height="90" />Greengeeks</a></p>
<p>Their management team has over 40 years of experience in providing high quality, affordable web site hosting. It is fully compatible with WordPress with an easy one-click installation.</p>
<p>Space: Unlimited                           Free Domain Name<br />
Traffic: Unlimited                         Host Unlimited Domains<br />
Price: $6.95                                    FREE Site Builder</p>
<p><a href="http://www.ixwebhosting.com/index.php/v2/pages.dspmain" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/09/10470363-4.gif" class="alignright size-full wp-image-544" title="10470363-4" alt="10470363-4" width="120" height="90" />IXwebhosting</a></p>
<p>One of the best WordPress hosting providers. Host multiple domains, 8 dedicated IP addresses, free site builder.</p>
<h3><a href="http://webhostinggeeks.com/" target="_blank">Top 10 Web Hosting — Best Web Hosts (2009)</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/541.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装插件出现问题时不妨检查一下数据库</title>
		<link>http://www.hopesun.info/526.html</link>
		<comments>http://www.hopesun.info/526.html#comments</comments>
		<pubDate>Sun, 13 Sep 2009 02:17:44 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=526</guid>
		<description><![CDATA[WordPress 是一个优秀的博客系统，功能强大，又非常容易上手，再加上有大量的插件可选择，使用中我们不可避免地频繁装、卸一些插件。一般说来这不会出现什么问题，但久而久之，你的数据库也许会有一些无用的表，一些不当的数据记录有时甚至会导致不可预料的结果。 下面就说说我昨天在安装使用Lc.Archivers插件时出现的一个问题，希望能对大家有帮助。 Lc.Archivers是一个很不错的插件，仿Discuz! Archiver，可以生成一个全静态的文章存档与站点地图。用它给BLOG做个文章备份也不错，一举两得。下载安装没有出现任何问题，一切正常的样子。 但仔细查验生成的文件，奇怪的很，有个目录（cat=7）对应的文件cat7-1.html总是不能生成。 起初怀疑是不是有插件冲突，经检查后排除了这种可能。至此，就连插件作者Lc.本人也觉得真是有点匪夷所思了。 在看了LC的插件代码后，受到了启发，觉得会不会是我数据库的数据有问题呢？ WP2.8的数据库现有11个表： wp_email wp_comments wp_links wp_options wp_postmeta wp_posts wp_term_relationships wp_term_taxonomy wp_terms wp_usermeta wp_users 其中wp_terms、wp_term_relationships、wp_term_taxonomy这三个表较为复杂，用来记录post_tag、category、link_category这些信息。 打开我的wp_term_taxonomy 表，怎么回事？！居然有两条term_id 为7的记录，分别对应一个category(term_taxonomy_id=7)和一个post_tag(term_taxonomy_id=8)。 将其中count为0的对应post_tag的那个term_id 修改后，问题解决了！同时删除了数据库中由于安装插件生成的几个无用的表格。 为何会产生两个term_id值相同的记录呢？有人有这种情况吗？难道是WP的一个BUG？ 通过这件事我想提醒大家，如果你在安装一些插件时出现意想不到的问题时，解决时不妨注意查看一下数据库中的相关记录，没准问题会出在这里。 图中对应term_taxonomy_id=8的那个term_id 修改为３。 延伸阅读：WordPress数据库]]></description>
			<content:encoded><![CDATA[<p>WordPress 是一个优秀的博客系统，功能强大，又非常容易上手，再加上有大量的插件可选择，使用中我们不可避免地频繁装、卸一些插件。一般说来这不会出现什么问题，但久而久之，你的数据库也许会有一些无用的表，一些不当的数据记录有时甚至会导致不可预料的结果。</p>
<p>下面就说说我昨天在安装使用Lc.Archivers插件时出现的一个问题，希望能对大家有帮助。</p>
<p>Lc.Archivers是一个很不错的插件，仿Discuz! Archiver，可以生成一个全静态的<a href="http://www.hopesun.info/archivers/index.html" target="_blank">文章存档与站点地图</a>。用它给BLOG做个文章备份也不错，一举两得。下载安装没有出现任何问题，一切正常的样子。</p>
<p>但仔细查验生成的文件，奇怪的很，有个目录（cat=7）对应的文件cat7-1.html总是不能生成。</p>
<p>起初怀疑是不是有插件冲突，经检查后排除了这种可能。至此，就连插件作者Lc.本人也觉得真是有点匪夷所思了。</p>
<p>在看了LC的插件代码后，受到了启发，觉得会不会是我数据库的数据有问题呢？<br />
<span id="more-526"></span><br />
WP2.8的数据库现有11个表：<br />
wp_email<br />
wp_comments<br />
wp_links<br />
wp_options<br />
wp_postmeta<br />
wp_posts<br />
wp_term_relationships<br />
wp_term_taxonomy<br />
wp_terms<br />
wp_usermeta<br />
wp_users</p>
<p>其中wp_terms、wp_term_relationships、wp_term_taxonomy这三个表较为复杂，用来记录post_tag、category、link_category这些信息。</p>
<p>打开我的wp_term_taxonomy 表，怎么回事？！居然有两条term_id 为7的记录，分别对应一个category(term_taxonomy_id=7)和一个post_tag(term_taxonomy_id=8)。</p>
<p>将其中count为0的对应post_tag的那个term_id 修改后，问题解决了！同时删除了数据库中由于安装插件生成的几个无用的表格。</p>
<p>为何会产生两个term_id值相同的记录呢？有人有这种情况吗？难道是WP的一个BUG？</p>
<p>通过这件事我想提醒大家，如果你在安装一些插件时出现意想不到的问题时，解决时不妨注意查看一下数据库中的相关记录，没准问题会出在这里。</p>
<p>图中对应term_taxonomy_id=8的那个term_id 修改为３。</p>
<p><img src="http://www.hopesun.info/wp-content/uploads/2009/09/2009-09-13_103310.jpg" title="2009-09-13_103310" alt="2009-09-13_103310" /></p>
<p>延伸阅读：<a href="http://codex.wordpress.org/zh-cn:%E6%95%B0%E6%8D%AE%E5%BA%93%E6%8F%8F%E8%BF%B0" target="_blank">WordPress数据库</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/526.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Addtoany：支持多种网站书签收藏</title>
		<link>http://www.hopesun.info/517.html</link>
		<comments>http://www.hopesun.info/517.html#comments</comments>
		<pubDate>Mon, 07 Sep 2009 03:08:56 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=517</guid>
		<description><![CDATA[博客上放一个书签，可以方便读者收藏你的文章。该功能通常都是用插件来实现，如水煮鱼的那个插件就不错，使用的人不少。 现在你也可以不必安装插件，只需在博客适当位置加上一段由Addtoany 提供的代码就实现了。无需注册，非常方便。提供的rss书签订阅和收藏书签，包含了大多数流行的提供收藏服务的网站。 本站现在用的收藏书签就是由addtoany提供的。 (用了两天，发现速度有点慢。撤掉。）]]></description>
			<content:encoded><![CDATA[<p>博客上放一个书签，可以方便读者收藏你的文章。该功能通常都是用插件来实现，如<a href="http://17fav.com/wp-plugin/" target="_blank">水煮鱼的那个插件</a>就不错，使用的人不少。</p>
<p><img src="http://www.hopesun.info/wp-content/uploads/2009/09/2009-09-14_113237.jpg" class=" size-full wp-image-531" title="2009-09-14_113237" alt="2009-09-14_113237" width="469" height="358" /></p>
<p>现在你也可以不必安装插件，只需在博客适当位置加上一段由<a href="http://www.addtoany.com/" target="_blank">Addtoany</a> 提供的代码就实现了。无需注册，非常方便。提供的rss书签订阅和收藏书签，包含了大多数流行的提供收藏服务的网站。</p>
<p><span style="text-decoration: line-through;">本站现在用的收藏书签就是由addtoany提供的。</span></p>
<p>(用了两天，发现速度有点慢。撤掉。）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/517.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>推荐一款新出的杂志风格免费主题Magasin Uno</title>
		<link>http://www.hopesun.info/431.html</link>
		<comments>http://www.hopesun.info/431.html#comments</comments>
		<pubDate>Tue, 03 Mar 2009 13:46:42 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=431</guid>
		<description><![CDATA[Magasin Uno is a free premium quality WordPress theme with Featured Content Gallery, Feedburner Email Subscription, Twitter Account integration, Popular Posts, Automatic Thumbnail Resizer, Adsense ready with advertising blocks easily customize via an Option Page. Released by Padd Solutions this is a simple magazine style free theme, with nice integration of Adsense links in the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.hopesun.info/wp-content/uploads/2009/03/magasin-wordpress-theme.jpg" class="alignleft size-full wp-image-93" title="magasin premium wordpress theme" alt="magasin premium wordpress theme" /><br />
Magasin Uno is a <a href="http://www.premiumwordpressthemes.co.uk/">free premium quality WordPress theme</a> with <a href="http://www.featuredcontentgallery.com/" target="_blank">Featured Content Gallery</a>, Feedburner Email Subscription, Twitter Account integration, Popular Posts, Automatic Thumbnail Resizer, Adsense ready with advertising blocks easily customize via an Option Page.</p>
<p>Released by <a href="http://paddsolutions.com/">Padd Solutions</a> this is a simple magazine style free theme, with nice integration of Adsense links in the header. The automatic thumbnail resizer is a nice touch.<br />
<span id="more-431"></span><br />
<strong>Theme features:</strong></p>
<ol>
<li>Magazine Style Layout</li>
<li>Compatible with WordPress version 2.7</li>
<li>Twitter Account Integration</li>
<li>Built-in Page Navigation</li>
<li>Featured Post Gallery</li>
<li>Option Page for Easy Customization</li>
<li>Feedburner Email Subscriber</li>
<li>Popular Posts</li>
<li>Automatic Thumbnail Resizer</li>
<li>Adsense Ready</li>
<li>Advertisement Blocks Ready</li>
<li>Gravatar Enabled</li>
<li>Threaded Comments</li>
</ol>
<p><strong><a href="http://www.paddsolutions.com/magasin/uno" target="_blank">Demo</a> | <a href="http://www.paddsolutions.com/wp-content/plugins/download-monitor/download.php?id=42">Download</a></strong></p>
<p><strong>类似主题：</strong></p>
<p style="text-align: center;"><a title="Magasin Tres Demo" href="http://www.paddsolutions.com/magasin/tres" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/03/demosmall.jpg" alt="Magasin Tres Screenshot" width="420" height="339" /> </a></p>
<p style="text-align: center;"><strong>Download <a title="Version 1 downloaded 700 times" href="http://www.paddsolutions.com/wp-content/plugins/download-monitor/download.php?id=44">Magasin Tres </a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/431.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>当前使用的主题</title>
		<link>http://www.hopesun.info/396.html</link>
		<comments>http://www.hopesun.info/396.html#comments</comments>
		<pubDate>Thu, 19 Feb 2009 06:53:50 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=396</guid>
		<description><![CDATA[接触WP一年多了，先后用过4个主题。这个主题本来是我用过的第3个主题，用了很长时间。在短暂的换用了第4个主题后，感觉还是比较喜欢简洁、2栏风格的主题。现在又换会来了。 这个主题，来自于Brian Gardner 的 great holiday WordPress theme“Tis The Season”。Brian Gardner 制作了很多优秀的WP主题，如 Church Theme、Lifestyle Theme等很受大家欢迎，使用的人很多。 Brian Gardner 后来似乎放弃了这个主题的更新。我现在使用的该主题，在原主题基础上修改了header部分，另对siderbar做了较大改动，几乎完全重新设计的侧边栏，随页面不同，会显示不同内容。 修改后的主题，无须安装任何插件，支持分页、显示相关日志、最新评论、评论最多日志。也完全兼容WP2.7的日志置顶及评论回复等功能。 在安装了postviews插件后，侧边栏会显示当前分类浏览最多的10篇日志。]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.hopesun.info/wp-content/uploads/2009/02/2009-02-192small.jpg" class="alignleft size-full wp-image-397" title="2009-02-192small" alt="2009-02-192small" /><br />
接触WP一年多了，先后用过4个主题。这个主题本来是我用过的第3个主题，用了很长时间。在短暂的换用了第4个主题后，感觉还是比较喜欢简洁、2栏风格的主题。现在又换会来了。</p>
<p>这个主题，来自于<a href="http://www.briangardner.com/">Brian Gardner </a>的 <a href="http://tistheseason.performancing.com/wp-content/uploads/2007/10/tis-the-season.png">great holiday WordPress theme</a>“Tis The Season”。Brian Gardner 制作了很多优秀的WP主题，如<br />
<a href="http://www.briangardner.com/themes/church">Church Theme</a>、<a href="http://www.briangardner.com/themes/lifestyle">Lifestyle Theme</a>等很受大家欢迎，使用的人很多。</p>
<p>Brian Gardner 后来似乎放弃了这个主题的更新。我现在使用的该主题，在原主题基础上修改了header部分，另对siderbar做了较大改动，几乎完全重新设计的侧边栏，随页面不同，会显示不同内容。</p>
<p>修改后的主题，无须安装任何插件，支持分页、显示相关日志、最新评论、评论最多日志。也完全兼容WP2.7的日志置顶及评论回复等功能。</p>
<p>在安装了postviews插件后，侧边栏会显示当前分类浏览最多的10篇日志。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/396.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>推荐四个不错的wordpress免费主题站</title>
		<link>http://www.hopesun.info/387.html</link>
		<comments>http://www.hopesun.info/387.html#comments</comments>
		<pubDate>Mon, 16 Feb 2009 09:12:20 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.hopesun.info/?p=387</guid>
		<description><![CDATA[目前提供154个主题免费下载。多数主题较简洁，易于上手。 地址：http://www.freewpthemes.net 提供8个主题演示和免费下载。其中几个杂志型主题，如ComFy Magazine 等，功能强大。 地址：http://deluxethemes.com 采用了Revolution Lifestyle theme制作的WP主题站。按2栏、三栏、杂志风格分类，更新较快。 地址：http://www.wpthemes.me/ 提供不同风格主题，免费。每个主题又有不同色调，多数有PSD文件。 地址：http://www.wpthemedesigner.com/]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.freewpthemes.net" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/02/2009-02-16_164943.png" title="2009-02-16_164943" alt="2009-02-16_164943" width="350" height="301" /></a><br />
目前提供154个主题免费下载。多数主题较简洁，易于上手。<br />
地址：<a href="http://www.freewpthemes.net">http://www.freewpthemes.net</a></p>
<p><a href="http://deluxethemes.com/" target="_blank"><img src="http://www.hopesun.info/wp-content/uploads/2009/02/2009-02-16_165811.png" title="2009-02-16_165811" alt="2009-02-16_165811" width="350" height="291" /></a><br />
提供8个主题演示和免费下载。其中几个杂志型主题，如ComFy Magazine 等，功能强大。<br />
地址：<a href="http://deluxethemes.com">http://deluxethemes.com</a><br />
<span id="more-387"></span><br />
<img src="http://www.hopesun.info/wp-content/uploads/2009/02/2009-02-25_214601.jpg" title="2009-02-25_214601" alt="2009-02-25_214601" /></p>
<p>采用了Revolution Lifestyle theme制作的WP主题站。按2栏、三栏、杂志风格分类，更新较快。<br />
地址：<a href="http://www.wpthemes.me/">http://www.wpthemes.me/</a></p>
<p><img src="http://www.hopesun.info/wp-content/uploads/2009/02/who.jpg" title="who" alt="who" width="325" height="406" /></p>
<p>提供不同风格主题，免费。每个主题又有不同色调，多数有PSD文件。<br />
地址：<a href="http://www.wpthemedesigner.com/">http://www.wpthemedesigner.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hopesun.info/387.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

