<?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://ale.net.cn/blog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://ale.net.cn/blog</link>
	<description>没有句号的梦想</description>
	<lastBuildDate>Thu, 26 Aug 2010 15:15:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>完全手动禁止Wordpress修订功能</title>
		<link>http://ale.net.cn/blog/2009/09/%e5%ae%8c%e5%85%a8%e6%89%8b%e5%8a%a8%e7%a6%81%e6%ad%a2wordpress%e4%bf%ae%e8%ae%a2%e5%8a%9f%e8%83%bd/</link>
		<comments>http://ale.net.cn/blog/2009/09/%e5%ae%8c%e5%85%a8%e6%89%8b%e5%8a%a8%e7%a6%81%e6%ad%a2wordpress%e4%bf%ae%e8%ae%a2%e5%8a%9f%e8%83%bd/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 08:11:33 +0000</pubDate>
		<dc:creator>ale</dc:creator>
				<category><![CDATA[程序]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ale.net.cn/blog/2009/09/%e5%ae%8c%e5%85%a8%e6%89%8b%e5%8a%a8%e7%a6%81%e6%ad%a2wordpress%e4%bf%ae%e8%ae%a2%e5%8a%9f%e8%83%bd/</guid>
		<description><![CDATA[去除Wordpress的修订历史功能。整个过程需要通过修改Wordpress的两个文件来实现：
1，打开 &#8216;wp-includes\default-filters.php&#8217; 文件，找到以下代码：
add_action( &#8216;pre_post_update&#8217;, &#8216;wp_save_post_revision&#8217; );

这段语句主要是在每次更新文章时，调用&#8217;pre_post_update&#8217; 这个函数，来创建修订版，所以在这段语句前添加 &#8216;//&#8217;将其转为注释，这样就可以安静了。
//add_action( &#8216;pre_post_update&#8217;, &#8216;wp_save_post_revision&#8217; );

但这样做还不完全，我们需要第二步修改，来完全的禁止修订功能。
2，打开 ‘wp-admin\includes\post.php’ 文件，找到以下代码：
return _wp_put_post_revision( $_POST, true );

修改为：
return edit_post();

这样以后每次在修改已发布文章时，就不再会出现修订版了。
有兴趣的朋友不妨试试，很不错的。不过缺点就是，每次升级Wordpress都需要重新修改，有点小麻烦。
]]></description>
			<content:encoded><![CDATA[<p>去除Wordpress的修订历史功能。整个过程需要通过修改Wordpress的两个文件来实现：</p>
<p>1，打开 &#8216;wp-includes\default-filters.php&#8217; 文件，找到以下代码：</p>
<blockquote><p>add_action( &#8216;pre_post_update&#8217;, &#8216;wp_save_post_revision&#8217; );</p>
</blockquote>
<p>这段语句主要是在每次更新文章时，调用&#8217;pre_post_update&#8217; 这个函数，来创建修订版，所以在这段语句前添加 &#8216;//&#8217;将其转为注释，这样就可以安静了。</p>
<blockquote><p>//add_action( &#8216;pre_post_update&#8217;, &#8216;wp_save_post_revision&#8217; );</p>
</blockquote>
<p>但这样做还不完全，我们需要第二步修改，来完全的禁止修订功能。</p>
<p>2，打开 ‘wp-admin\includes\post.php’ 文件，找到以下代码：</p>
<blockquote><p>return _wp_put_post_revision( $_POST, true );</p>
</blockquote>
<p>修改为：</p>
<blockquote><p>return edit_post();</p>
</blockquote>
<p>这样以后每次在修改已发布文章时，就不再会出现修订版了。</p>
<p>有兴趣的朋友不妨试试，很不错的。不过缺点就是，每次升级Wordpress都需要重新修改，有点小麻烦。</p>
]]></content:encoded>
			<wfw:commentRss>http://ale.net.cn/blog/2009/09/%e5%ae%8c%e5%85%a8%e6%89%8b%e5%8a%a8%e7%a6%81%e6%ad%a2wordpress%e4%bf%ae%e8%ae%a2%e5%8a%9f%e8%83%bd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为wordpress绑定多个域名</title>
		<link>http://ale.net.cn/blog/2009/08/%e4%b8%bawordpress%e7%bb%91%e5%ae%9a%e5%a4%9a%e4%b8%aa%e5%9f%9f%e5%90%8d/</link>
		<comments>http://ale.net.cn/blog/2009/08/%e4%b8%bawordpress%e7%bb%91%e5%ae%9a%e5%a4%9a%e4%b8%aa%e5%9f%9f%e5%90%8d/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 15:31:10 +0000</pubDate>
		<dc:creator>ale</dc:creator>
				<category><![CDATA[程序]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[多域名]]></category>

		<guid isPermaLink="false">http://ale.net.cn/blog/?p=89</guid>
		<description><![CDATA[按照默认设置，wordpress只能绑定一个域名，与域名相关的两个option选项是siteurl和home，这些域名数据存在数据库里。
但是，自定义常量的优先级要高于数据库。所以，对于有多个镜像的blog，可以通过修改wp-config.php为Wordpress绑定多个域名。
将以下代码插入到wp-config.php中，就会根据域名设置wordpress的目录和显示目录。
if ($_SERVER['HTTP_HOST']==&#8221;www.w2.com&#8221;):
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w2.com&#8221;);
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w2.com&#8221;);
elseif ($_SERVER['HTTP_HOST']==&#8221;www.w3.com&#8221;):
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w3.com&#8221;);
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w3.com&#8221;);
else :
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w4.com&#8221;);
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w4.com&#8221;);
endif;
]]></description>
			<content:encoded><![CDATA[<p>按照默认设置，wordpress只能绑定一个域名，与域名相关的两个option选项是siteurl和home，这些域名数据存在数据库里。</p>
<p>但是，<strong><span style="color: #ff0000;">自定义常量的优先级要高于数据库</span></strong>。所以，对于有多个镜像的blog，可以通过修改wp-config.php为Wordpress绑定多个域名。</p>
<p>将以下代码插入到wp-config.php中，就会根据域名设置wordpress的目录和显示目录。</p>
<p>if ($_SERVER['HTTP_HOST']==&#8221;www.w2.com&#8221;):<br />
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w2.com&#8221;);<br />
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w2.com&#8221;);<br />
elseif ($_SERVER['HTTP_HOST']==&#8221;www.w3.com&#8221;):<br />
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w3.com&#8221;);<br />
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w3.com&#8221;);<br />
else :<br />
 define(&#8221;WP_SITEURL&#8221;, &#8220;http://www.w4.com&#8221;);<br />
 define(&#8221;WP_HOME&#8221;, &#8220;http://www.w4.com&#8221;);<br />
endif;</p>
]]></content:encoded>
			<wfw:commentRss>http://ale.net.cn/blog/2009/08/%e4%b8%bawordpress%e7%bb%91%e5%ae%9a%e5%a4%9a%e4%b8%aa%e5%9f%9f%e5%90%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在WordPress中获取指定分类下的全部tag</title>
		<link>http://ale.net.cn/blog/2009/08/%e5%9c%a8wordpress%e4%b8%ad%e8%8e%b7%e5%8f%96%e6%8c%87%e5%ae%9a%e5%88%86%e7%b1%bb%e4%b8%8b%e7%9a%84%e5%85%a8%e9%83%a8tag/</link>
		<comments>http://ale.net.cn/blog/2009/08/%e5%9c%a8wordpress%e4%b8%ad%e8%8e%b7%e5%8f%96%e6%8c%87%e5%ae%9a%e5%88%86%e7%b1%bb%e4%b8%8b%e7%9a%84%e5%85%a8%e9%83%a8tag/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 13:53:46 +0000</pubDate>
		<dc:creator>ale</dc:creator>
				<category><![CDATA[程序]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ale.net.cn/blog/?p=87</guid>
		<description><![CDATA[&#60;?php
    query_posts(&#8217;category_name=work&#8217;);
    if (have_posts()) : while (have_posts()) : the_post();
        $posttags = get_the_tags();
        if ($posttags) {
            foreach($posttags as $tag) {
                $all_tags_arr[] = $tag -&#62; name; //用 $tag 把 $all_tags_arr 变成多维数组，再由array_unique函数进行处理
            }
        }
    endwhile; endif;
    $tags_arr = array_unique($all_tags_arr); //去除重复的tag
    echo &#8216;&#60;pre&#62;&#8217;.print_r($tags_arr, true).&#8217;&#60;/pre&#62;&#8217;; //输出tag
?&#62;
 别忘了把“query_posts(&#8217;category_name=work&#8217;);”里的分类名改成你需要的分类名。
为验证，先收藏。
]]></description>
			<content:encoded><![CDATA[<p>&lt;?php<br />
    query_posts(&#8217;category_name=work&#8217;);<br />
    if (have_posts()) : while (have_posts()) : the_post();<br />
        $posttags = get_the_tags();<br />
        if ($posttags) {<br />
            foreach($posttags as $tag) {<br />
                $all_tags_arr[] = $tag -&gt; name; //用 $tag 把 $all_tags_arr 变成多维数组，再由array_unique函数进行处理<br />
            }<br />
        }<br />
    endwhile; endif;</p>
<p>    $tags_arr = array_unique($all_tags_arr); //去除重复的tag<br />
    echo &#8216;&lt;pre&gt;&#8217;.print_r($tags_arr, true).&#8217;&lt;/pre&gt;&#8217;; //输出tag</p>
<p>?&gt;</p>
<p> 别忘了把“query_posts(&#8217;category_name=work&#8217;);”里的分类名改成你需要的分类名。</p>
<p>为验证，先收藏。</p>
]]></content:encoded>
			<wfw:commentRss>http://ale.net.cn/blog/2009/08/%e5%9c%a8wordpress%e4%b8%ad%e8%8e%b7%e5%8f%96%e6%8c%87%e5%ae%9a%e5%88%86%e7%b1%bb%e4%b8%8b%e7%9a%84%e5%85%a8%e9%83%a8tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
