<?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>PageTalks &#187; Wordpress</title>
	<atom:link href="http://pagetalks.com/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://pagetalks.com</link>
	<description>Pure Web Development &#38; Design Ideas</description>
	<lastBuildDate>Thu, 19 Jan 2012 12:06:33 +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>Immigrate  WordPress &#8211; A Real Case</title>
		<link>http://pagetalks.com/2012/01/14/immigrate-wordpress-a-real-case.html</link>
		<comments>http://pagetalks.com/2012/01/14/immigrate-wordpress-a-real-case.html#comments</comments>
		<pubDate>Sat, 14 Jan 2012 12:39:12 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Site Development]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=539</guid>
		<description><![CDATA[上个星期，我终于决定把elfvision.com上的博客移到robinqu.me这个新域名上。由于使用wordpress已经很多年了，前前后后也做过不少wordpress的维护工作了，自我感觉良好，不料这次遇到不少麻烦，遂整... ]]></description>
			<content:encoded><![CDATA[<p>上个星期，我终于决定把elfvision.com上的博客移到robinqu.me这个新域名上。由于使用wordpress已经很多年了，前前后后也做过不少wordpress的维护工作了，自我感觉良好，不料这次遇到不少麻烦，遂整理成文。</p>
<p>分析一下我这里的案例，其实是要做以下这些事情（原站点简称A，新站点简称B）：</p>
<ol>
<li>制作A在B下的镜像</li>
<li>修改B下面的镜像Wordpress中域名设置</li>
<li>对A站相关地址进行转向到B站域名</li>
<li>清理A站的旧文件</li>
<li>在A站和B站上同时发出公告，安抚、告知用户</li>
</ol>
<h3>制作站点镜像</h3>
<p>开头很重要，如果你的站点无时无刻有访问量并产生数据，你面临两种选择：1、临时关闭站点，挂出维护通知 2、站点切换后再灌入差量数据。所幸，Wordpress站点往往基本没有实时数据，我的做法是没有关闭原站，而是直接复制数据的。</p>
<p>假设你可以登陆你的服务器，那么直接远程SSH就可以完成对文件的复制，即将wordpress站点的根目录直接复制到新位置。如果不能，那么就通过FTP慢慢拖吧⋯⋯</p>
<p>至于数据库部分，如果安装了phpMyAdmin，可以登陆到管理后台，直接选中数据库，然后在Operation选项卡中有Copy database的功能。</p>
<p>否则就得登陆mysql客户端，执行mysqldump了：</p>
<pre><code>mysqldump [db1] -u root -ppassword --add-drop-table | mysql [db2] -u root -ppassword</code></pre>
<p><span id="more-539"></span><br />
<h3>切换域名</h3>
<p>到这个时候，如果的B站点域名指向和主机配置都正确，访问B站应该被转向了A站，因为B站内部的wordpress设置的域名还是A站的。</p>
<p>切换域名分两方面：</p>
<ul>
<li>WordPress配置内部的域名设置</li>
<li>文章内容里面的链接内容</li>
</ul>
<p>对于前者，有两种办法，一种是直接登陆MYSQL，用SQL修改wp-options表的两条纪录，即siteurl和home的option_value。</p>
<pre><code>UPDATE  `wp`.`wp_options` SET  `option_value` =  'new_site_url' WHERE  `wp_options`.`option_name` ='home';
UPDATE  `wp`.`wp_options` SET  `option_value` =  'new_wordpress_url' WHERE  `wp_options`.`option_name` ='siteurl';
</code></pre>
<p>或者修改B站下面的wp_config.php，加入如下两句：</p>
<pre><code>define('WP_SITEURL', 'new_wordpress_url');
define('WP_HOME', 'new_site_url');</code></pre>
<h3>对A站的地址进行转向</h3>
<p>不少注重SEO的同学应该会单行A域名的PR值突然下降，那么我们可以设置nginx或者Apache的主机配置文件对以往链接进行304转向，将伤害降到尽可能小。</p>
<pre><code>server {
    listen 80;
    server_name www.siteB.com;

    index index.php index.html;
    root /var/www/siteB;

    location / {
        error_page 404 = /index.php?q=$uri;
		<strong>rewrite ^/(\d+)/(\d+)/(.*)$ http://siteB$request_uri permanent;</strong>
    }

}</code></pre>
<p>注意替换rewrite规则中的域名。详细文档：<a href="http://wiki.nginx.org/HttpRewriteModule#rewrite">http://wiki.nginx.org/HttpRewriteModule#rewrite</a>。</p>
<p>rewrite后面接受的第一个参数是url中path部分的正则匹配，这个正则应该按照之前wordpress的permanent链接的模式来写，最后一个参数permanent表示是304永久重定向。</p>
<p>注意，如果你是将Wordpress程序在同一个域名中迁移，例如从http://siteA.com/blog/迁移到http://siteA.com/，那么你可以尝试nginx的try_files规则：<a href="http://wiki.nginx.org/HttpCoreModule#try_files">http://wiki.nginx.org/HttpCoreModule#try_files</a>。</p>
<p>有一篇文章专门降到了利用这个指令来进行同域名不同虚拟目录的迁移：<a href="http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive">http://michaelshadle.com/2009/03/19/finally-using-nginxs-try-files-directive</a>。</p>
<p>对于文章内部的链接数据，则要再次登陆MYSQL控制台或phpMyAdmin进行操作了。</p>
<p><code>
<pre>UPDATE wp_posts SET guid = replace(guid, 'http://www.siteA.com','http://www.siteB.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.siteA.com', 'http://www.siteB.com');
</pre>
<p></code></p>
<h3>清理旧文件</h3>
<p>登陆FTP或者SSH执行文件删除吧，不过个人建议不要删除，把所有文件都备份到另一个目录，带迁移成功后的一两个月之后再考虑是否删除。这样可以避免突发事件时的尴尬。</p>
<h3>通知用户</h3>
<p>好吧， 在两边都贴上大大的告示吧，以免用户感到困惑⋯⋯</p>
<h3>Next…</h3>
<p>我更新了另外一篇文章来阐述node里面的一些新加入crypto相关的API：<a href="http://pagetalks.com/2012/01/18/more-about-crypto-module-in-nodejs.html">http://pagetalks.com/2012/01/18/more-about-crypto-module-in-nodejs.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2012/01/14/immigrate-wordpress-a-real-case.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Free WordPress Themes of 2009</title>
		<link>http://pagetalks.com/2010/03/26/the-best-free-wordpress-themes-of-2009.html</link>
		<comments>http://pagetalks.com/2010/03/26/the-best-free-wordpress-themes-of-2009.html#comments</comments>
		<pubDate>Fri, 26 Mar 2010 13:07:18 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Digest]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=370</guid>
		<description><![CDATA[In this article, we’re presenting our picks for the best free WordPress themes of 2009. There were plenty of free themes created in 2009, but here are the ones that we feel had a little something extra that made them stand out from the crowd. If you th... ]]></description>
			<content:encoded><![CDATA[<div class="text-en" lang="en">
In this article, we’re presenting our picks for the best free WordPress themes of 2009. There were plenty of free themes created in 2009, but here are the ones that we feel had a little something extra that made them stand out from the crowd. If you think we missed or left one out, let us know about them in the comments.
</div>
<div class="text-cn" lang="zh">
老外的Wordpress主题，有什么好说的呢，不乏大家熟悉的，例如Composito、Irresistible。用的时候要注意他们对中文字体支持并不是很好。拿过来就修改一下CSS吧。
</div>
<p><a href="http://webdesignledger.com/freebies/the-best-free-wordpress-themes-of-2009" class="external digest-continue more-link">Read More</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/03/26/the-best-free-wordpress-themes-of-2009.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>13 Useful Code Snippets for WordPress Development</title>
		<link>http://pagetalks.com/2010/03/26/13-useful-code-snippets-for-wordpress-development.html</link>
		<comments>http://pagetalks.com/2010/03/26/13-useful-code-snippets-for-wordpress-development.html#comments</comments>
		<pubDate>Fri, 26 Mar 2010 12:57:39 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Digest]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=368</guid>
		<description><![CDATA[WordPress has grown to be commonly defined as the core solution for your blogging needs. It is the most recognized and sought after Content Management System by writers and designers. Consequently, over the past few years there has been a voluble increas... ]]></description>
			<content:encoded><![CDATA[<div class="text-en" lang="en">
WordPress has grown to be commonly defined as the core solution for your blogging needs. It is the most recognized and sought after Content Management System by writers and designers. Consequently, over the past few years there has been a voluble increase in WordPress blogs, this has caused the “need” for useful tips, tricks, and hacks, all made to allow the customizing of your WordPress powered site. Here are 13 code snippets or hacks that will help you extend the capabilities of your WordPress site.
</div>
<div class="text-cn" lang="zh">
老外的文章总是“XX条关于XX的建议”，把发散的事物进行归纳，然后线性的罗列，这就是他们的思维。也是解释他们为何如此严谨的一个位置。<br />
Wordpress人人用，你记录过你写模板时的常用代码么？在我印象中，我总是翻看自己下载的那些Cheetsheets⋯⋯<br />
不过最近用上了一个叫<a href="http://www.apple.com/downloads/macosx/development_tools/snippet.html">Snippet</a>的小软件，极大程度上的提高了代码收集、重用的能力啊。这不是广告⋯⋯
</div>
<p><a href="http://webdesignledger.com/tips/13-useful-code-snippets-for-wordpress-development" class="external digest-continue more-link">Read More</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/03/26/13-useful-code-snippets-for-wordpress-development.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get to Know the WordPress Hierarchy</title>
		<link>http://pagetalks.com/2010/03/23/get-to-know-the-wordpress-hierarchy.html</link>
		<comments>http://pagetalks.com/2010/03/23/get-to-know-the-wordpress-hierarchy.html#comments</comments>
		<pubDate>Tue, 23 Mar 2010 12:27:17 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[Digest]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=355</guid>
		<description><![CDATA[WordPress’s popularity and usefulness as a multi-purpose content management system, continues to grow, and the more people flock to using this CMS the more an understanding of some of the basics of how it operates becomes necessary. In that vein, I hav... ]]></description>
			<content:encoded><![CDATA[<p><img alt="the WordPress Hierarchy" src="http://www.problogdesign.com/wp-content/uploads/2010/02/header5.jpg" title="the WordPress Hierarchy" class="aligncenter" width="560" height="145" /></p>
<div class="text-en" lang="en">WordPress’s popularity and usefulness as a multi-purpose content management system, continues to grow, and the more people flock to using this CMS the more an understanding of some of the basics of how it operates becomes necessary.</p>
<p>In that vein, I have put together this post that examines the WordPress template hierarchy and the use of conditional statements. Technically you only need two files for a WordPress theme to work, index.php and style.css.</p></div>
<div class="text-cn" lang="zh">
Wordpress的模板系统是其最大的魅力，这篇文章讲解了Wordpress的模板体系结构。对于喜欢制作Wordpress主题的同学有很多帮助。
</div>
<p><a href="http://www.dzinepress.com/2010/03/50-excellent-tutorials-for-web-development-using-css3/" class="digest-continue more-link external">Read More</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/03/23/get-to-know-the-wordpress-hierarchy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharethis jQuery Plugin</title>
		<link>http://pagetalks.com/2010/03/21/sharethis-jquery-plugin.html</link>
		<comments>http://pagetalks.com/2010/03/21/sharethis-jquery-plugin.html#comments</comments>
		<pubDate>Sun, 21 Mar 2010 05:26:27 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sharethis]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=328</guid>
		<description><![CDATA[Introduction A jquery plugin that enable sharing anywhere. This plugin needs fancybox lightbox effect! You can change it by editing lightbox function in sharethis.js to use you own lightbox effect. A wordpress plugin that integra this scirpt is avaliable... ]]></description>
			<content:encoded><![CDATA[<div class="text-en" lang="en">
<h3>Introduction</h3>
<p>A jquery plugin that enable sharing anywhere.</p>
<p>This plugin needs <a href="http://fancybox.net/">fancybox</a> lightbox effect! You can change it by editing lightbox function in sharethis.js to use you own lightbox effect.<br />
A wordpress plugin that integra this scirpt is avaliable on : <a href="http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html">http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html</a>
</div>
<div class="text-cn" lang="zh">
添加“分享”按钮到你想要的地方。<br />
这个插件需要<a href="http://fancybox.net/">fancybox</a>的lightbox效果! 你也可以自己更改自己为自己的lightbox效果。<br />
使用该脚本的Wordpress的插件可以在这里找到 : <a href="http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html">http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html</a></p>
</div>
<p><span id="more-328"></span></p>
<div class="text-en" lang="en">
<h3>Download</h3>
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>Markups</h3>
<pre>
&lt;a href="the link you want to share" class="sharethis-button" rel="Title of the page you want ot share"&gt;Share&lt;/a&gt;</pre>
<p>By default, it will share this link in href attribute, and use rel attribute as title of the share.<br />
If you leave these two attribute blank, it will take path in location bar as link, and title of current page as the title of the share.</p>
<h3>Installation</h3>
<ol>
<li>Include fancybox scripts! or use your own lightbox effect</li>
<li>Include sharethis.js and sharethis.css</li>
</ol>
<p>By default, it will listen for click events on any element with a &#8220;sharethis-button&#8221; class to display a dialog.</p>
<h3>Parameters</h3>
<dl>
<dd>iconPath (String)</dd>
<dt>the path for icons of social sites</dt>
<dd>lightbox (function)</dd>
<dt>your own implementation of lightbox effect, taking html string &#8220;data&#8221; as the only argument, e.g.</p>
<pre>function(data) {
			$.fancybox(data);
		}</pre>
</dt>
<dt>extra (Array)</dt>
<dd>array that can supplyment the sites array, e.g. </p>
<pre>extra : [{name: "XX", url: "XX", icon: "XX.gif"},{name: "XX", url: "XX", icon: "XX.gif"}]</pre>
</dd>
</dl>
<h3>Changelog</h3>
<dl>
<dt>1.0</dt>
<dd>First Release of Sharethis Plugin</dd>
</dl>
</div>
<div class="text-cn" lang="zh">
<h3>下载</h3>
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>HTML标记</h3>
<pre>
&lt;a href="the link you want to share" class="sharethis-button" rel="Title of the page you want ot share"&gt;Share&lt;/a&gt;</pre>
<p>默认状态下，它将把href属性当作你要分享的链接地址，rel属性当作分享的标题。<br />
如果你没有设置这两个属性，那么它就将当前页面的地址和标题当作默认属性。</p>
<h3>安装</h3>
<ol>
<li>引用fancybox的脚本，或者自定义自己的lightbox效果</li>
<li>引用sharethis.js和sharethis.css</li>
</ol>
<p>默认情况下它会监听所有“sharethis-button&#8221;类的点击行为，并激活分享对话框。</p>
<h3>Parameters</h3>
<dl>
<dd>iconPath (String)</dd>
<dt>the path for icons of social sites</dt>
<dd>lightbox (function)</dd>
<dt>lightbox的接口函数，调用时会传递一个data的html代码字符串，例如：</p>
<pre>function(data) {
			$.fancybox(data);
		}</pre>
</dt>
<dt>extra (Array)</dt>
<dd>补充社交站点的数组, 例如. </p>
<pre>extra : [{name: "XX", url: "XX", icon: "XX.gif"},{name: "XX", url: "XX", icon: "XX.gif"}]</pre>
</dd>
</dl>
<h3>更新日志</h3>
<dl>
<dt>1.0</dt>
<dd>第一个发行版本</dd>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/03/21/sharethis-jquery-plugin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin &#8211; Free Share</title>
		<link>http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html</link>
		<comments>http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html#comments</comments>
		<pubDate>Sun, 21 Mar 2010 04:55:04 +0000</pubDate>
		<dc:creator>Robin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[sharethis]]></category>
		<category><![CDATA[socials]]></category>

		<guid isPermaLink="false">http://pagetalks.com/?p=323</guid>
		<description><![CDATA[Introduction Add &#8220;Share&#8221; Button to anywhere you want! You don&#8217;t need to register in the Sharing or bookmarks site like Sharethis.com to embed a &#8220;Share&#8221; button! and you can choose your own lightbox effect to speed up the ui. ... ]]></description>
			<content:encoded><![CDATA[<div class="text-en" lang="en">
<h3>Introduction</h3>
<p>Add &#8220;Share&#8221; Button to anywhere you want!<br />
You don&#8217;t need to register in the Sharing or bookmarks site like Sharethis.com to embed a &#8220;Share&#8221; button!<br />
and you can choose your own lightbox effect to speed up the ui.</p>
<p>This plugin needs <a href="http://fancybox.net/">fancybox</a> lightbox effect! You can change it by editing lightbox function in sharethis.js to use you own lightbox effect.</p>
</div>
<div class="text-cn" lang="zh">添加“分享”按钮到你想要的地方。你也不必注册Sharethis.com之类的站点，同时你可以控制自己的站点列表！<br />
FreeShare能够带给你这些！<br />
这个插件需要<a href="http://fancybox.net/">fancybox</a>的lightbox效果! 你也可以自己更改自己为自己的lightbox效果。</p>
</div>
<p><span id="more-323"></span></p>
<div class="text-en" lang="en">
<h3>Download</h3>
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>Installation</h3>
<ol>
<li>Include fancybox scripts! or use your own lightbox effect</li>
<li>Upload whole `freeshare` folder to the `/wp-content/plugins/` directory</li>
<li>Activate the plugin through the &#8216;FreeShare&#8217; menu in WordPress</li>
<li>Place `&lt;?php share-button();  ?&gt;` in the loop or in a single, PAGE</li>
</ol>
<h3>Frequently Asked Questions</h3>
<dl>
<dt>Why are there so many strange social sites in the list?</dt>
<dd>the default social sites list is made for users in China. You can easily custom it </dd>
<dt>How to use my own lightbox effect</dt>
<dd>open freeshare/sharethis/sharethis.js, you can find line 17, change the implementation of this function to adjust to your own lightbox effect</dd>
<dt>How to custom the site list</dt>
<dd>You can open freeshare/sharethis/sharethis.js, and you won&#8217;t miss the array that stores the site data.<br />
Don&#8217;t forget to assign an icon to each site.</dd>
<dt>Is there any option panel or something</dt>
<dd>No, at least in tis edition.</dd>
</dl>
<h3>Changelog</h3>
<dl>
<dt>1.0</dt>
<dd>First Release of FreeShare Plugin</dd>
</dl>
</div>
<div class="text-cn" lang="zh">
<h3>下载</h3>
Note: There is a file embedded within this post, please visit this post to download the file.
<h3>安装</h3>
<ol>
<li>引入Fancybox脚本，或者使用自己的lightbox效果</li>
<li>上传`freeshare` 整个文件夹到 `/wp-content/plugins/` 目录</li>
<li>在后台中激活 &#8216;FreeShare&#8217;</li>
<li>将 `&lt;?php share-button();  ?&gt;`放在loop循环中，或者PAGE、single的页面中</li>
</ol>
<h3>常见问题</h3>
<dl>
<dt>怎么会有这么多奇怪的社交站点？</dt>
<dd>默认列表是为中国用户准备的，你也可以去自定义这个列表的 </dd>
<dt>如何使用</dt>
<dd>打开freeshare/sharethis/sharethis.js,你可以在第17行找到lightbox函数, 你可以更改该函数的实现来兼容你的lightbox效果</dd>
<dt>如何自定义这个列表</dt>
<dd>打开 freeshare/sharethis/sharethis.js, 你应该能够很快看到储存社交站点数据的数组，修改吧！记得每个站点的图标文件</dd>
<dt>有插件的选项页面么？</dt>
<dd>没，至少这个版本没有</dd>
</dl>
<h3>更新日志</h3>
<dl>
<dt>1.0</dt>
<dd>FreeShara第一次发行</dd>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
