<?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>thdp&#039;s blog &#187; Wordpress</title>
	<atom:link href="http://thdp.org/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://thdp.org</link>
	<description>崇尚技术，享受生活</description>
	<lastBuildDate>Mon, 27 Feb 2012 22:50:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>HotNews主题实现缩略图按比例缩放</title>
		<link>http://thdp.org/tech/hotnews-thumbnail-keep-ratio/</link>
		<comments>http://thdp.org/tech/hotnews-thumbnail-keep-ratio/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 17:48:30 +0000</pubDate>
		<dc:creator>thdp</dc:creator>
				<category><![CDATA[科技]]></category>
		<category><![CDATA[HotNews]]></category>
		<category><![CDATA[ratio]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[比例]]></category>
		<category><![CDATA[缩略图]]></category>

		<guid isPermaLink="false">http://thdp.org/?p=266</guid>
		<description><![CDATA[最近在wopus上逛，发现一个很不错的国人自制主题 HotNews pro 2.4。仿苹果风格的导航栏，页面风格简洁大气，杂志型首页，焦点幻灯，文章摘要缩略图。主题自身集成了很多原本由插件实现的功能，使用起来很方便。之前用了两年的atahualpa主题，新的一年了，正好换个新面貌。安装上以后，经过一番自己的定制，感觉网站明显提升了一个档次。 现在发现唯一一点缺憾是缩略图功能，模板自带的缩放功能使用固定缩略图尺寸。而如果文章没有特别制作对应尺寸的缩略图，模板会自动截取文章里第一张图。很多时候这第一张图并不符合模板设定的长宽比，结果导致缩略图变形拉伸。询问过作者后，建议使用别的缩略图插件。我自己捣鼓了一下，通过修改css样式和对应php文件，只限定一个尺寸，而由浏览器自动调整另一个尺寸。这样基本保证了图片按原比例缩放，目前一点不足是某些缩略图会超出原有设定编框。 1. 首页焦点幻灯 首先需要修改的是样式表/css/home.css 对于image，删掉width:400px; 只设定height。相应的适当修改post的width 接下来修改/includes/slider.php 同样删除width:400px; 只设定height 2. 首页缩略图 首先需要修改的是样式表style.css 删掉height:100px; 只设定width 接下来修改/includes/thumbnail.php 同样删除height=&#8221;100px&#8221; 到这里就基本完工了。不过我发现某些照片过长，导致缩略图下边的日期跑到了图片上。我这里直接删除了日期显示，在杂志类首页文件cms.php 将 替换为空格。 3. 分类页的缩略图，改过的css在这里也已经生效。我做的修改是把缩略图下面的日期替换为空格，文章标题下面的“发表于“替换为日期 打开archive.php 将 替换为 而下面的日期同样用空格替换。 分享到： 更多 &#124;2&#124;left]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-269" title="HotNews-pro" src="http://thdp.org/wp-content/uploads/2011/01/HotNews-pro.png" alt="" width="168" height="149" />最近在wopus上逛，发现一个很不错的国人自制主题 <a href="http://zmingcx.com/hotnews-pro-theme-24.html/trackback" target="_blank">HotNews pro 2.4</a>。仿苹果风格的导航栏，页面风格简洁大气，杂志型首页，焦点幻灯，文章摘要缩略图。主题自身集成了很多原本由插件实现的功能，使用起来很方便。之前用了两年的atahualpa主题，新的一年了，正好换个新面貌。安装上以后，经过一番自己的定制，感觉网站明显提升了一个档次。</p>
<p>现在发现唯一一点缺憾是缩略图功能，模板自带的缩放功能使用固定缩略图尺寸。而如果文章没有特别制作对应尺寸的缩略图，模板会自动截取文章里第一张图。很多时候这第一张图并不符合模板设定的长宽比，结果导致缩略图变形拉伸。询问过作者后，建议使用别的缩略图插件。我自己捣鼓了一下，通过修改css样式和对应php文件，只限定一个尺寸，而由浏览器自动调整另一个尺寸。这样基本保证了图片按原比例缩放，目前一点不足是某些缩略图会超出原有设定编框。</p>
<p><strong>1. 首页焦点幻灯</strong><br />
首先需要修改的是样式表/css/home.css</p>
<pre class="brush: css; title: ; notranslate">.slider_image,.slider_image img {
	float: left;
	width:400px;
	height:248px;
	}
.slider_post {
	float:right;
	width:280px;
	padding-right:10px;
	}</pre>
<p>对于image，删掉width:400px; 只设定height。相应的适当修改post的width<br />
接下来修改/includes/slider.php</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;slider_image&quot;&gt;
				&lt;?php if ( get_post_meta($post-&gt;ID, 'show', true) ) : ?&gt;
				&lt;?php $image = get_post_meta($post-&gt;ID, 'show', true); ?&gt;
				&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php echo $image; ?&gt;&quot;width=&quot;400&quot; height=&quot;248&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;/&gt;&lt;/a&gt;
				&lt;?php else: ?&gt;
					&lt;?php if (has_post_thumbnail()) { the_post_thumbnail('home-thumb' ,array('class' =&gt; 'home-thumb')); }
				else { ?&gt;
					&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;img class=&quot;home-thumb&quot; src=&quot;&lt;?php echo catch_first_image() ?&gt;&quot; width=&quot;400px&quot; height=&quot;248px&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;/&gt;&lt;/a&gt;
				&lt;?php } ?&gt;
				&lt;?php endif; ?&gt;
			&lt;/div&gt;</pre>
<p>同样删除width:400px; 只设定height</p>
<p><strong>2. 首页缩略图</strong><br />
首先需要修改的是样式表style.css</p>
<pre class="brush: css; title: ; notranslate">.thumbnail_t img,.thumbnail img{
	position:absolute;
	width: 140px;
	height:100px;
	}</pre>
<p>删掉height:100px; 只设定width</p>
<p>接下来修改/includes/thumbnail.php</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;thumbnail&quot;&gt;
	&lt;?php if (has_post_thumbnail()) { the_post_thumbnail('home-thumb' ,array('class' =&gt; 'home-thumb')); }
		else { ?&gt;
		&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;img class=&quot;home-thumb&quot; src=&quot;&lt;?php echo catch_first_image() ?&gt;&quot; width=&quot;140px&quot;  height=&quot;100px&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;/&gt;&lt;/a&gt;
	&lt;?php } ?&gt;
	&lt;?php endif; ?&gt;
&lt;/div&gt;</pre>
<p>同样删除height=&#8221;100px&#8221;</p>
<p>到这里就基本完工了。不过我发现某些照片过长，导致缩略图下边的日期跑到了图片上。我这里直接删除了日期显示，在杂志类首页文件cms.php</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;thumbnail_box&quot;&gt;
	&lt;?php include('includes/thumbnail.php'); ?&gt;
	&lt;span class=&quot;postdate&quot;&gt;&lt;?php the_time('Y年m月d日') ?&gt;&lt;/span&gt;
&lt;/div&gt;
</pre>
<p>将</p>
<pre class="brush: plain; title: ; notranslate">&lt;?php the_time('Y年m月d日') ?&gt;</pre>
<p>替换为空格。</p>
<p>3. 分类页的缩略图，改过的css在这里也已经生效。我做的修改是把缩略图下面的日期替换为空格，文章标题下面的“发表于“替换为日期<br />
打开archive.php</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;archive_info&quot;&gt;
	&lt;span class=&quot;date&quot;&gt;发表于&lt;?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . '前'; ?&gt;&lt;/span&gt;
	&lt;span class=&quot;category&quot;&gt; &amp;#8260; &lt;?php the_category(', ') ?&gt;&lt;/span&gt;
	&lt;span class=&quot;comment&quot;&gt; &amp;#8260; &lt;?php comments_popup_link('暂无评论', '评论数 1', '评论数 %'); ?&gt;&lt;/span&gt;
	&lt;?php if(function_exists('the_views')) { print ' &amp;#8260; 被围观 '; the_views(); print '+';  } ?&gt;
	&lt;span class=&quot;edit&quot;&gt;&lt;?php edit_post_link('&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;', '  ', '  '); ?&gt;&lt;/span&gt;
&lt;/div&gt;

&lt;div class=&quot;thumbnail_box&quot;&gt;
	&lt;?php include('includes/thumbnail.php'); ?&gt;
	&lt;span class=&quot;postdate&quot;&gt;&lt;?php the_time('Y年m月d日') ?&gt;&lt;/span&gt;
&lt;/div&gt;</pre>
<p>将</p>
<pre class="brush: plain; title: ; notranslate">发表于&lt;?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . '前'; ?&gt;</pre>
<p>替换为</p>
<pre class="brush: plain; title: ; notranslate">&lt;?php the_time('Y年m月d日') ?&gt;</pre>
<p>而下面的日期同样用空格替换。</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="ckepop">
	<span class="jiathis_txt">分享到：</span>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_douban"></a>
	<a class="jiathis_button_google"></a>
	<a class="jiathis_button_fb"></a>
	<a class="jiathis_button_twitter"></a>
	<a class="jiathis_button_msn"></a>
	<a class="jiathis_button_email"></a>
	<a class="jiathis_button_copy"></a>
	<a class="jiathis_button_print"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">更多</a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->|2|left</div>]]></content:encoded>
			<wfw:commentRss>http://thdp.org/tech/hotnews-thumbnail-keep-ratio/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>推荐3个Flickr的WordPress插件</title>
		<link>http://thdp.org/tech/website/amazing-wordpress-plugin-for-flickr/</link>
		<comments>http://thdp.org/tech/website/amazing-wordpress-plugin-for-flickr/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 05:08:35 +0000</pubDate>
		<dc:creator>thdp</dc:creator>
				<category><![CDATA[网站相关|WordPress]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[相册]]></category>

		<guid isPermaLink="false">http://thdp.org/uncategorized/test</guid>
		<description><![CDATA[试过许多flickr相册相关的插件，在使用一段时间后，我来介绍一下在站内相册，边栏显示缩略图，文章嵌入图片方面做得很不错的三个插件。 1. Flickr Gallery 将某个flickr账号内的全部图片以相册形式整合到网站内。使用方法非常简单，只需在一个页面里加上这个代码flickr-gallery。可以分tab显示photostream, sets, interesting, 新版开始支持收费账户的collections。设置每页显示图片数目，自动分页。此外还支持lightbox特效显示图片。 2. flickrRSS 可以导入某个账号的rss，并以缩略图形式显示，很适合做边栏的widget，比如我主页左边的Flickr favorites。但是它默认显示的格式不是很美观，两列之间没留间隙。解决的办法很巧妙(原文链接)，利用它的自定义html，将每个缩略图定为一个div，然后在css里设置margin。 比如在before list里定义div id=&#8221;flickrrss&#8221;，同时在after list里结束div。css文件里添加这么一行即可。 3. Flickr Manager 管理flickr账号里的图片，直接插入图片到文章里。我最喜欢的一个功能是可以一次将整个set的图片插入文章，极大减少了工作量。但是里面有个小bug，图片尺寸在界面里设置无效，需要手动更改thumbnail=&#8221;xxx&#8221;部分的代码。同样支持lightbox和highslider特效显示图片，个人认为highslider更炫一些。wordpress升级到2.8后此插件不兼容，图片无法插入，解决的办法是到这里下载网友制作的更新版。 http://wordpress.org/support/topic/281990 分享到： 更多 &#124;2&#124;left]]></description>
			<content:encoded><![CDATA[<p><a href="http://thdp.org/wp-content/uploads/2009/11/flickr-logo.png"><img class="alignright size-thumbnail wp-image-181" title="flickr-logo" src="http://thdp.org/wp-content/uploads/2009/11/flickr-logo.png" alt="flickr-logo" width="200" /></a>试过许多flickr相册相关的插件，在使用一段时间后，我来介绍一下在站内相册，边栏显示缩略图，文章嵌入图片方面做得很不错的三个插件。</p>
<p>1. <a href="http://co.deme.me/projects/flickr-gallery/" target="_blank">Flickr Gallery</a></p>
<p>将某个flickr账号内的全部图片以相册形式整合到网站内。使用方法非常简单，只需在一个页面里加上这个代码<code>flickr-gallery</code>。可以分tab显示photostream, sets, interesting, 新版开始支持收费账户的collections。设置每页显示图片数目，自动分页。此外还支持lightbox特效显示图片。</p>
<p>2. <a href="http://eightface.com/wordpress/flickrrss/" target="_blank">flickrRSS</a></p>
<p>可以导入某个账号的rss，并以缩略图形式显示，很适合做边栏的widget，比如我主页左边的Flickr favorites。但是它默认显示的格式不是很美观，两列之间没留间隙。解决的办法很巧妙(<a href="http://coryholt.org/blog/2009/05/styling-the-flickrrss-plugin-for-wordpress/" target="_blank">原文链接</a>)，利用它的自定义html，将每个缩略图定为一个div，然后在css里设置margin。</p>
<p>比如在before list里定义div id=&#8221;flickrrss&#8221;，同时在after list里结束div。css文件里添加这么一行即可。</p>
<pre class="brush: xml; title: ; notranslate">div#flickrrss img {margin:2px 4px;}</pre>
<p>3. <a href="http://tgardner.net/" target="_blank">Flickr Manager</a></p>
<p>管理flickr账号里的图片，直接插入图片到文章里。我最喜欢的一个功能是可以一次将整个set的图片插入文章，极大减少了工作量。但是里面有个小bug，图片尺寸在界面里设置无效，需要手动更改thumbnail=&#8221;xxx&#8221;部分的代码。同样支持lightbox和highslider特效显示图片，个人认为highslider更炫一些。wordpress升级到2.8后此插件不兼容，图片无法插入，解决的办法是到这里下载网友制作的更新版。<br />
<a href="http://wordpress.org/support/topic/281990" target="_blank">http://wordpress.org/support/topic/281990</a></p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="ckepop">
	<span class="jiathis_txt">分享到：</span>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_douban"></a>
	<a class="jiathis_button_google"></a>
	<a class="jiathis_button_fb"></a>
	<a class="jiathis_button_twitter"></a>
	<a class="jiathis_button_msn"></a>
	<a class="jiathis_button_email"></a>
	<a class="jiathis_button_copy"></a>
	<a class="jiathis_button_print"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">更多</a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->|2|left</div>]]></content:encoded>
			<wfw:commentRss>http://thdp.org/tech/website/amazing-wordpress-plugin-for-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress插件总结</title>
		<link>http://thdp.org/tech/website/wordpress-plugins/</link>
		<comments>http://thdp.org/tech/website/wordpress-plugins/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 13:59:55 +0000</pubDate>
		<dc:creator>thdp</dc:creator>
				<category><![CDATA[网站相关|WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://thdp.org/?p=17858</guid>
		<description><![CDATA[使用wordpress写blog几个月后，现在的主题下同时使用了20多个插件，运行速度还不错。下面就总结一下我使用的插件，希望能给后边wordpress的新手一些帮助。 1. 必装插件(8个) Akismet, 过滤垃圾评论 Dagon design sitemap generator，生成站点地图，或者叫文章索引，对访客了解你的站点内容很有帮助，同时也显得更专业。 Google XML sitemaps，为blog生成搜索引擎专用的sitemap.xml，支持ask.com, google, windows live, yahoo Simple tags, 强大的标签管理工具，批量操作，彩色标签云显示 Wordpress database backup，自动备份数据库 WP-pagenavi, 页面导航，替换原有的previous/next，显示多个页码 WP-postviews, 记录文章访问次数 WP Kit CN, 针对中文优化的摘要设置 2. 建议安装 All in one SEO pack, 搜索引擎优化 Global translator，自动将你的blog翻译成多种语言，而且可以整合到sitemap里，支持缓存 Header and footer, 方便的在页眉和页脚里填入代码 Hot friends, 根据评论数自动生成友情链接 Sociable，在文章底部添加一行收藏标签，支持常用的digg, del.icio, facebook, google, live, myspace等 3. 可选安装 [...]]]></description>
			<content:encoded><![CDATA[<p>使用wordpress写blog几个月后，现在的主题下同时使用了20多个插件，运行速度还不错。下面就总结一下我使用的插件，希望能给后边wordpress的新手一些帮助。<a href="http://www.flickr.com/photos/lloyds-screenies/2880354958"><img class="alignright size-full wp-image-113" title="wp-logo" src="http://thdp.org/wp-content/uploads/2009/06/wp-logo.jpg" alt="wp-logo" width="231" height="231" /></a></p>
<p>1. 必装插件(8个)<br />
Akismet, 过滤垃圾评论<br />
Dagon design sitemap generator，生成站点地图，或者叫文章索引，对访客了解你的站点内容很有帮助，同时也显得更专业。<br />
Google XML sitemaps，为blog生成搜索引擎专用的sitemap.xml，支持ask.com, google, windows live, yahoo<br />
Simple tags, 强大的标签管理工具，批量操作，彩色标签云显示<br />
Wordpress database backup，自动备份数据库<br />
WP-pagenavi, 页面导航，替换原有的previous/next，显示多个页码<br />
WP-postviews, 记录文章访问次数<br />
WP Kit CN, 针对中文优化的摘要设置</p>
<p>2. 建议安装<br />
All in one SEO pack, 搜索引擎优化<br />
Global translator，自动将你的blog翻译成多种语言，而且可以整合到sitemap里，支持缓存<br />
Header and footer, 方便的在页眉和页脚里填入代码<br />
Hot friends, 根据评论数自动生成友情链接<br />
Sociable，在文章底部添加一行收藏标签，支持常用的digg, del.icio, facebook, google, live, myspace等</p>
<p>3. 可选安装<br />
Delete revision, 删除数据库里文章的备份<br />
Exec-PHP，在文章里直接执行php语句<br />
Flickr gallery，将flickr里的图片整合到你的blog相册，目前支持photostream, sets, most interesting三类内容，内建lightbox特效<br />
Flickr manager，管理flickr里的图片，直接插入图片到文章里<br />
flickrRSS，读取flickr里的图片，可以widget形式显示，我现在用的是我收藏的favorite照片<br />
Syntaxhighlighter evolved, 语法高亮文章里的代码<br />
Thumbnail for excerpts, 为文章摘要添加缩略图，不需单独上传，自动由正文里第一个图片生成<br />
Wordpress related posts, 相关文章，可以插入文章尾部和RSS中<br />
WP-CMS post control, 关闭自动备份文章功能</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="ckepop">
	<span class="jiathis_txt">分享到：</span>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_douban"></a>
	<a class="jiathis_button_google"></a>
	<a class="jiathis_button_fb"></a>
	<a class="jiathis_button_twitter"></a>
	<a class="jiathis_button_msn"></a>
	<a class="jiathis_button_email"></a>
	<a class="jiathis_button_copy"></a>
	<a class="jiathis_button_print"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">更多</a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->|2|left</div>]]></content:encoded>
			<wfw:commentRss>http://thdp.org/tech/website/wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>对wordpress的文章ID重新编号</title>
		<link>http://thdp.org/tech/website/renumbering-wordpress-post-id/</link>
		<comments>http://thdp.org/tech/website/renumbering-wordpress-post-id/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 00:13:28 +0000</pubDate>
		<dc:creator>thdp</dc:creator>
				<category><![CDATA[网站相关|WordPress]]></category>
		<category><![CDATA[ID]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[renumber]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[文章]]></category>
		<category><![CDATA[编号]]></category>

		<guid isPermaLink="false">http://thdp.org/uncategorized/%e5%af%b9wordpress%e7%9a%84%e6%96%87%e7%ab%a0id%e9%87%8d%e6%96%b0%e7%bc%96%e5%8f%b7</guid>
		<description><![CDATA[对ID重新编号的原因基于以下两个方面： 1) WP新版默认打开自动保存和版本控制，如果在线撰写文章的话就会留下很多备份，而每一个备份都会在数据库里留下一个记录，造成数据文件的臃肿，更重要的是最后版本的文章ID号就不连续了。新版WP在控制台里同时隐藏了ID号，不知是不是出于“眼不见心不凡”的考虑。要查看ID号可以到phpmyadmin里打开数据库，或者安装Restore Post Id插件。 2) blog搬家时，尤其是从博客服务商(BSP)转向独立博客时，原有的ID号很可能是所有用户共用，所以ID号会很高。像我之前在yo2上20多篇文章，ID号就跑到了9000多。 从网上查了好多资料，有人提出修改数据库的AUTO_INCREMENT参数，但是这个方法只是对以后新的文章编号起作用，无法对已有的文章重新编号。Mysql网站上也说得很清楚，这个参数无法重设为小于当前编号的数值。 之后终于找到了 Renumber Primary Key 这篇文章，基本上解决了问题。原理很简单，先删除原来的ID列，然后增加同名列ID，属性设为AUTO_INCREMENT。此处还必须指定为PRIMARY KEY，否则会出错。FIRST是将此列放到第一列的位置，否则默认是放在最后一列。 提醒大家在修改前都要对原数据库先备份以防万一。但是目前此方法还不是最优化的方法。文章ID修改后，原来相关的标签，分类，评论都还没改过来。对于初建博客的新手来说，手动修改的工作量还不算很大，但是对于文章数很多的博客，此方法并不很适用。 补充：批量修改标签，推荐simple tags插件；修改评论对应的文章ID，目前我是直接在phpmyadmin里写sql语句，每次可以更正一篇文章下的所有评论(将下面的new和old替换为新的ID和旧的ID) 分享到： 更多 &#124;2&#124;left]]></description>
			<content:encoded><![CDATA[<p>对ID重新编号的原因基于以下两个方面：<br />
1) WP新版默认打开自动保存和版本控制，如果在线撰写文章的话就会留下很多备份，而每一个备份都会在数据库里留下一个记录，造成数据文件的臃肿，更重要的是最后版本的文章ID号就不连续了。新版WP在控制台里同时隐藏了ID号，不知是不是出于“眼不见心不凡”的考虑。要查看ID号可以到phpmyadmin里打开数据库，或者安装Restore Post Id插件。</p>
<p>2) blog搬家时，尤其是从博客服务商(BSP)转向独立博客时，原有的ID号很可能是所有用户共用，所以ID号会很高。像我之前在yo2上20多篇文章，ID号就跑到了9000多。</p>
<p>从网上查了好多资料，有人提出修改数据库的AUTO_INCREMENT参数，但是这个方法只是对以后新的文章编号起作用，无法对已有的文章重新编号。Mysql网站上也说得很清楚，这个参数无法重设为小于当前编号的数值。</p>
<p>之后终于找到了<a href="http://www.tek-tips.com/viewthread.cfm?qid=1485076&amp;page=1" target="_blank"> Renumber Primary Key</a> 这篇文章，基本上解决了问题。原理很简单，先删除原来的ID列，然后增加同名列ID，属性设为AUTO_INCREMENT。此处还必须指定为PRIMARY KEY，否则会出错。FIRST是将此列放到第一列的位置，否则默认是放在最后一列。</p>
<pre class="brush: sql; title: ; notranslate">ALTER TABLE `wp_posts` DROP `ID`;
OPTIMIZE TABLE `wp_posts`;
ALTER TABLE `wp_posts` ADD `ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
</pre>
<p>提醒大家在修改前都要对原数据库先备份以防万一。但是目前此方法还不是最优化的方法。文章ID修改后，原来相关的标签，分类，评论都还没改过来。对于初建博客的新手来说，手动修改的工作量还不算很大，但是对于文章数很多的博客，此方法并不很适用。</p>
<p>补充：批量修改标签，推荐simple tags插件；修改评论对应的文章ID，目前我是直接在phpmyadmin里写sql语句，每次可以更正一篇文章下的所有评论(将下面的new和old替换为新的ID和旧的ID)</p>
<pre class="brush: sql; title: ; notranslate">UPDATE `wp_comments` SET `comment_post_ID`=new WHERE `comment_post_ID`=old</pre>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="ckepop">
	<span class="jiathis_txt">分享到：</span>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_douban"></a>
	<a class="jiathis_button_google"></a>
	<a class="jiathis_button_fb"></a>
	<a class="jiathis_button_twitter"></a>
	<a class="jiathis_button_msn"></a>
	<a class="jiathis_button_email"></a>
	<a class="jiathis_button_copy"></a>
	<a class="jiathis_button_print"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">更多</a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->|2|left</div>]]></content:encoded>
			<wfw:commentRss>http://thdp.org/tech/website/renumbering-wordpress-post-id/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

