<?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; 代码</title>
	<atom:link href="http://bulog.org/tag/code/feed" rel="self" type="application/rss+xml" />
	<link>http://bulog.org</link>
	<description>希望给你自由</description>
	<lastBuildDate>Tue, 13 Dec 2011 02:27:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>可以这样回到顶部</title>
		<link>http://bulog.org/share/wordpress/go-top.html</link>
		<comments>http://bulog.org/share/wordpress/go-top.html#comments</comments>
		<pubDate>Sat, 24 Apr 2010 14:56:20 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1921</guid>
		<description><![CDATA[回到网页顶部的效果不少，有加个#的，有滑上去，有弹上去的。但是把几种 jQuery 效果混合起来回到顶部大概不多。纠其原因，此举除了有让一些急性子的人等不及效果结束就关闭网页的可能，另一个重要原因是因为 IE家族 对 JS 微“软”的支持。几种漂亮的效果加在一起，在 IE 下却是惨不忍睹。 但这不能阻碍我们对视觉享受的追求。 下面是我晚上写的一段代码，预览请尽量在 chrome,firefox中完成。 首先加载: 1 &#60;script src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;!--mce:0--&#62;&#60;/script&#62; 把以下代码保存调用： 1 2 3 4 5 6 $&#40;document&#41;.ready&#40;function&#40;&#41;&#123; $&#40;'#gotop'&#41;.click&#40;function&#40;&#41;&#123; $&#40;'#wrap'&#41;.fadeTo&#40;&#34;200&#34;, 0.3, function&#40;&#41;&#123;$&#40;'html, body'&#41;.animate&#40;&#123;scrollTop: 0&#125;,800&#41;;&#125;&#41;; $&#40;'#wrap'&#41;.delay&#40;800&#41;.fadeTo&#40;&#34;200&#34;, 1&#41;; &#125;&#41;; &#125;&#41;; 请根据实际主题代码更换：#gotop、#wrap 补充：如果加载的是 jQuery 1.4以下的版本，使用以下代码： 1 &#8230; <a href="http://bulog.org/share/wordpress/go-top.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>回到网页顶部的效果不少，有加个#的，有滑上去，有弹上去的。但是把几种 <a href="http://bulog.org/tag/jquery">jQuery</a> 效果混合起来回到顶部大概不多。纠其原因，此举除了有让一些急性子的人等不及效果结束就关闭网页的可能，另一个重要原因是因为 IE家族 对 JS 微“软”的支持。几种漂亮的效果加在一起，在 IE 下却是惨不忍睹。<br />
<span id="more-1921"></span> 但这不能阻碍我们对视觉享受的追求。<br />
下面是我晚上写的一段代码，预览请尽量在 chrome,firefox中完成。<br />
首先加载:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;</pre></td></tr></table></div>

<p>把以下代码保存调用：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#gotop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrap'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;200&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.3</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html, body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>scrollTop<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">800</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrap'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">800</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;200&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>请根据实际主题代码更换：#gotop、#wrap</p>
<p>补充：如果加载的是 jQuery 1.4以下的版本，使用以下代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#gotop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrap'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.2</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html, body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>scrollTop<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">800</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#wrap'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/go-top.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>滑动关闭侧边栏(基于jQuery1.4)</title>
		<link>http://bulog.org/share/wordpress/close-sidebar.html</link>
		<comments>http://bulog.org/share/wordpress/close-sidebar.html#comments</comments>
		<pubDate>Fri, 23 Apr 2010 03:56:47 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1894</guid>
		<description><![CDATA[本文介绍的滑动效果，演示见本站文章页导航栏（关闭边栏）。之前在林木木的博客看到《关闭/显示侧边栏》一文，忍不住试了一下，但是对实际效果不太满意，于是一直没用。昨天翻看 jQuery 参考时，看到 1.4 版之后新出的几个函数，又想起“干掉边栏”这事，放上一试，感觉效果不坏，于是就有了这篇文章。 要实现此效果，首先需要加载 1.4 或更新版本的 jQuery 库： &#60;script src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;!--mce:0--&#62;&#60;/script&#62; Html(加一个判断语句，只在文章页显示) &#60;?php if &#40;is_single&#40;&#41;&#41; &#123; ?&#62; &#60;li id=&#34;close-sidebar&#34;&#62;&#60;a&#62;关闭边栏&#60;/a&#62;&#60;/li&#62; &#60;?php &#125; ?&#62; CSS(显示小手) #close-sidebar&#123;cursor:pointer&#125; JS(delay为新增函数) $&#40;'#close-sidebar a'&#41;.toggle&#40;function&#40;&#41;&#123; $&#40;this&#41;.text&#40;&#34;显示边栏&#34;&#41;; $&#40;'#sidebar'&#41;.slideUp&#40;400&#41;;//用400毫秒的时间收起边栏 $&#40;'#main'&#41;.delay&#40;500&#41;.animate&#40;&#123;width: &#34;930px&#34;&#125;, 600&#41;;//花500毫秒等待边栏收起后，用600毫秒的时间加宽主栏 &#125;,function&#40;&#41;&#123; $&#40;this&#41;.text&#40;&#34;关闭边栏&#34;&#41;; $&#40;'#main'&#41;.animate&#40;&#123;width: &#34;649px&#34;&#125;, 600&#41;; $&#40;'#sidebar'&#41;.delay&#40;700&#41;.slideDown&#40;400&#41;; &#8230; <a href="http://bulog.org/share/wordpress/close-sidebar.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>本文介绍的滑动效果，演示见本站文章页导航栏（关闭边栏）。之前在林木木的博客看到《<a href="http://immmmm.com/close-show-sidebar-simple-code.html" target="_blank">关闭/显示侧边栏</a>》一文，忍不住试了一下，但是对实际效果不太满意，于是一直没用。昨天翻看 jQuery 参考时，看到 1.4 版之后新出的几个函数，又想起“干掉边栏”这事，放上一试，感觉效果不坏，于是就有了这篇文章。<span id="more-1894"></span></p>
<p>要实现此效果，首先需要加载 1.4 或更新版本的 jQuery 库：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;!--</span>mce<span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">--&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Html(加一个判断语句，只在文章页显示)</p>

<div class="wp_syntax"><div 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>is_single<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: #000000; font-weight: bold;">?&gt;</span>
&lt;li id=&quot;close-sidebar&quot;&gt;&lt;a&gt;关闭边栏&lt;/a&gt;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>CSS(显示小手)</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#close-sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>JS(delay为新增函数)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#close-sidebar a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>toggle<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;显示边栏&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>slideUp<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//用400毫秒的时间收起边栏</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#main'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>delay<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;930px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//花500毫秒等待边栏收起后，用600毫秒的时间加宽主栏</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;关闭边栏&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#main'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;649px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>delay<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">700</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>slideDown<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>补充：如果不想用jquery 1.4实现，可以使用以下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#close-sidebar a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>toggle<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
	$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;显示边栏&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>slideUp<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#main'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;930px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;关闭边栏&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#main'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;649px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">600</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>slideDown<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/24 -- <a href="http://bulog.org/share/wordpress/go-top.html" title="可以这样回到顶部">可以这样回到顶部</a> (13)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/close-sidebar.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>wordpress 默认小工具修改表</title>
		<link>http://bulog.org/share/wordpress/default-widgets.html</link>
		<comments>http://bulog.org/share/wordpress/default-widgets.html#comments</comments>
		<pubDate>Thu, 22 Apr 2010 12:49:07 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1888</guid>
		<description><![CDATA[WordPress 默认的边栏小工具代码写在default-widgets.php(wp-includes/default-widgets.php)。此文件中每个类对应一个小工具，如修改 RSS 样式（来自任何 RSS 或 Atom feed 的条目），只要找到 WP_Widget_RSS 这一类修改即可。以下是功能即与名称对照表： Widget名称 Widget类名 Widget介绍 页面 WP_Widget_Pages 您博客的 WordPress 页面 日历 WP_Widget_Calendar 您博客的文章日程表 文章索引模板 WP_Widget_Archives 您博客文章的月度存档 链接 WP_Widget_Links 您的链接表 功能 WP_Widget_Meta 登入/登出，管理，Feed 和 WordPress 链接 搜索 WP_Widget_Search 您博客的搜索框 文本 WP_Widget_Text 任意文本或HTML 分类目录 &#8230; <a href="http://bulog.org/share/wordpress/default-widgets.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress 默认的边栏小工具代码写在default-widgets.php(<em>wp-includes/default-widgets.php</em>)。此文件中每个类对应一个小工具，如修改 RSS 样式<em>（来自任何 RSS 或 Atom feed 的条目）</em>，只要找到 WP_Widget_RSS 这一类修改即可。以下是功能即与名称对照表：<span id="more-1888"></span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100">
<div><strong>Widget名称</strong></div>
</td>
<td width="200">
<div><strong>Widget类名</strong></div>
</td>
<td width="280">
<div><strong>Widget介绍</strong></div>
</td>
</tr>
<tr>
<td>页面</td>
<td>WP_Widget_Pages</td>
<td>您博客的 <a title="wordpress 分类" href="http://bulog.org/share/wordpress">WordPress </a>页面</td>
</tr>
<tr>
<td>日历</td>
<td>WP_Widget_Calendar</td>
<td>您博客的文章日程表</td>
</tr>
<tr>
<td>文章索引模板</td>
<td>WP_Widget_Archives</td>
<td>您博客文章的月度存档</td>
</tr>
<tr>
<td>链接</td>
<td>WP_Widget_Links</td>
<td>您的链接表</td>
</tr>
<tr>
<td>功能</td>
<td>WP_Widget_Meta</td>
<td>登入/登出，管理，Feed 和 WordPress 链接</td>
</tr>
<tr>
<td>搜索</td>
<td>WP_Widget_Search</td>
<td>您博客的搜索框</td>
</tr>
<tr>
<td>文本</td>
<td>WP_Widget_Text</td>
<td>任意文本或HTML</td>
</tr>
<tr>
<td>分类目录</td>
<td>WP_Widget_Categories</td>
<td>列表或是下拉菜单的分类目录</td>
</tr>
<tr>
<td>最近文章</td>
<td>WP_Widget_Recent_Posts</td>
<td>您博客的最近文章</td>
</tr>
<tr>
<td>最新评论</td>
<td>WP_Widget_Recent_Comments</td>
<td>最在侧边栏显示最新评论的列表</td>
</tr>
<tr>
<td>RSS</td>
<td>WP_Widget_RSS</td>
<td>来自任何 RSS 或 Atom feed 的条目</td>
</tr>
<tr>
<td>标签云</td>
<td>WP_Widget_Tag_Cloud</td>
<td>您最常使用的标签云</td>
</tr>
</tbody>
</table>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li><li>2011/03/08 -- <a href="http://bulog.org/logs/essay/wen-he.html" title="温和一点">温和一点</a> (13)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/default-widgets.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>无插件实现 wordpress 彩色标签云效果</title>
		<link>http://bulog.org/share/wordpress/wordpress-colore-tag.html</link>
		<comments>http://bulog.org/share/wordpress/wordpress-colore-tag.html#comments</comments>
		<pubDate>Tue, 23 Mar 2010 15:09:11 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1639</guid>
		<description><![CDATA[边栏的标签云（Tag Cloud）是 WordPress 2.3 版以后的内置功能，在后台小工具中直接拖动添加即可。不过标签字体默认情况尺寸不同，但色彩一致，看起来相当杂乱。虽然有 Simple Tags 等插件可以为标签上色，但几行代码就可以实现的功能还是不插了。 使用方法： 将以下代码放入主题包 functions.php 文件中（如果没有这个文件，新建保存即可）： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 &#60;?php function colorCloud&#40;$text&#41; &#123; $text = preg_replace_callback&#40;'&#124;&#60;a (.+?)&#62;&#124;i', 'colorCloudCallback', $text&#41;; return $text; &#125; function &#8230; <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>边栏的标签云（Tag Cloud）是 WordPress 2.3 版以后的内置功能，在后台小工具中直接拖动添加即可。不过标签字体默认情况尺寸不同，但色彩一致，看起来相当杂乱。虽然有 Simple Tags 等插件可以为标签上色，但几行代码就可以实现的功能还是不插了。<span id="more-1639"></span></p>
<p><strong>使用方法：</strong></p>
<p>将以下代码放入主题包 <strong>functions.php</strong> 文件中<em>（如果没有这个文件，新建保存即可）</em>：</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
</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: #000000; font-weight: bold;">function</span> colorCloud<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace_callback</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|&lt;a (.+?)&gt;|i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'colorCloudCallback'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">function</span> colorCloudCallback<span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dechex</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">16777215</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/style=(\'|\&quot;)(.*)(\'|\&quot;)/i'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#<span style="color: #006699; font-weight: bold;">{$color}</span>;<span style="color: #006699; font-weight: bold;">$2</span>;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;&lt;a <span style="color: #006699; font-weight: bold;">$text</span>&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'colorCloud'</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: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>第8行代码&#8221;$color=dechex(rand(0,16777215));&#8221;</strong>：作用是定义标签随机颜色的十进制数值范围，0 等于 #000000，16777215 等于 #ffffff。你可以使用进制换算工具换算后修改这行代码，改变颜色范围。</p>
<p>修改完成后，使用下面这段代码在博客中调用或者直接在小工具中添加标签模块即可：</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> wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smallest=8&amp;largest=24&amp;number=50'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>函数说明</strong>：</p>
<ul>
<li>
“smallest”：最小的字体尺寸（使用频率最少的标签）</li>
<li>
“largest”：最大的字体尺寸（频率最多的）</li>
<li>
“number”：则表示标签显示数量。</li>
</ul>
<p>对于大多数不熟悉 php 的用户，这一小改动的最大难点在于如何向 functions.php 中插入代码。因此我把代码加了头尾，使用时请直接将本文第一段代码粘贴到 functions.php 的<strong>末尾处</strong>。</p>
<p><a href="http://bulog.org/archives" target="_blank"><img class="alignnone" title="预览" src="http://bulog.org/demo.gif" alt="预览" width="60" height="20" /></a></p>
<p><em>本文源代码来自<a href="http://www.chinaz.com/Webbiz/Exp/09229253R009.html" target="_blank">站长网</a>。</em></p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li><li>2011/03/08 -- <a href="http://bulog.org/logs/essay/wen-he.html" title="温和一点">温和一点</a> (13)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/wordpress-colore-tag.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>17行代码为 wordpress 添加评论表情列表</title>
		<link>http://bulog.org/share/wordpress/wordpress-smilies-code.html</link>
		<comments>http://bulog.org/share/wordpress/wordpress-smilies-code.html#comments</comments>
		<pubDate>Sat, 13 Mar 2010 11:09:04 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1470</guid>
		<description><![CDATA[为 WordPress 添加评论表情列表可以用插件解决，但把它集成到模板中更方便日后维护。这段代码不是我写的，我只是把它从一个叫做 wp-smilies 的插件中扒了出来，不加注释它只有17行代码，没有必要让这个文件独立存在加载。 使用方法：把代码放到模板 comments.php 文件中的合适位置，效果见本站。 具体代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 &#60;!--smilies--&#62; &#60;?php function wp_smilies&#40;&#41; &#123; global $wpsmiliestrans; if &#40; !get_option&#40;'use_smilies'&#41; or &#40;empty&#40;$wpsmiliestrans&#41;&#41;&#41; &#8230; <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>为 <a href="http://bulog.org/share/wordpress">WordPress</a> 添加评论表情列表可以用插件解决，但把它集成到模板中更方便日后维护。这段代码不是我写的，我只是把它从一个叫做 wp-smilies 的插件中扒了出来，不加注释它只有17行代码，没有必要让这个文件独立存在加载。<br />
<span id="more-1470"></span>使用方法：把代码放到模板 comments.php 文件中的合适位置，效果见本站。<br />
具体代码如下：</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;!--smilies--&gt;        
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> wp_smilies<span style="color: #009900;">&#40;</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;">$wpsmiliestrans</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'use_smilies'</span><span style="color: #009900;">&#41;</span> or <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpsmiliestrans</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$smilies</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_unique</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpsmiliestrans</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$link</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$smilies</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$smile</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-includes/images/smilies/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$smile</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$img</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">{$file}</span><span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">{$smile}</span><span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$imglink</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$link</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#commentform<span style="color: #000099; font-weight: bold;">\&quot;</span> title=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">{$smile}</span><span style="color: #000099; font-weight: bold;">\&quot;</span> onclick=<span style="color: #000099; font-weight: bold;">\&quot;</span>document.getElementById('comment').value += '<span style="color: #006699; font-weight: bold;">{$value}</span>'<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">{$img}</span>&lt;/a&gt;&amp;nbsp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;wp_smilies&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_smilies<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;!--smilies--&gt;</pre></td></tr></table></div>

<p>感谢 wp-smilies 的作者 <a target="_blank" href="http://www.thinkagain.cn/">ThinkAgain</a>，如果你感觉此文不妥，请来信告知。</p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li><li>2011/03/08 -- <a href="http://bulog.org/logs/essay/wen-he.html" title="温和一点">温和一点</a> (13)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/wordpress-smilies-code.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Simple-hezi（wp主题）</title>
		<link>http://bulog.org/share/wordpress/simple-hezi.html</link>
		<comments>http://bulog.org/share/wordpress/simple-hezi.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:15:44 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1399</guid>
		<description><![CDATA[主题：Simple-hezi，基于 wordpress 自带主题 Classic 演绎而成，宽度自适应。 演示：http://hulog.cn/ 版本：1.0(大概不会有2.0了) 关键字：白灰，两栏，简洁，wordpress theme Simple-hezi，顾名思义，简洁的盒子。主题包只有 30k，特别适合博客放置在国外并且喜欢简洁的用户。 如果哪位朋友使用了请留言通知我，我会把你的站作为演示，目前作演示站的那个空间快要到期了。 相关日志2010/04/23 -- 滑动关闭侧边栏(基于jQuery1.4) (20)2010/04/22 -- wordpress 默认小工具修改表 (16)2010/03/23 -- 无插件实现 wordpress 彩色标签云效果 (13)2010/03/13 -- 17行代码为 wordpress 添加评论表情列表 (20)2010/03/12 -- dotbox (wordpress主题) (72)2010/02/26 -- 去掉wp分类目录前的category(非插件) (14)]]></description>
			<content:encoded><![CDATA[<p><strong>主题：</strong><a href="http://bulog.org/share/wordpress/simple-hezi.html">Simple-hezi</a>，基于 wordpress 自带主题 Classic 演绎而成，宽度自适应。<br />
<strong>演示：</strong><a href="http://hulog.cn/" target="_blank">http://hulog.cn/</a><br />
<strong>版本：</strong>1.0(大概不会有2.0了)<br />
<strong>关键字：</strong>白灰，两栏，简洁，<a href="http://bulog.org/share/wordpress">wordpress</a> theme<br />
<span id="more-1399"></span> <a href="http://hulog.cn/" target="_blank"><img class="alignnone" title="预览" src="http://bulog.org/demo.gif" alt="预览" width="60" height="20" /></a><a href="http://dotknow.googlecode.com/files/Simple-hezi.zip" target="_blank"><img class="alignnone" title="下载" src="http://bulog.org/down.gif" alt="下载" width="60" height="20" /></a></p>
<p>Simple-hezi，顾名思义，简洁的盒子。主题包只有 30k，特别适合博客放置在国外并且喜欢简洁的用户。</p>
<p>如果哪位朋友使用了请留言通知我，我会把你的站作为演示，目前作演示站的那个空间快要到期了。</p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/12 -- <a href="http://bulog.org/share/wordpress/dotbox.html" title="dotbox (wordpress主题)">dotbox (wordpress主题)</a> (72)</li><li>2010/02/26 -- <a href="http://bulog.org/share/wordpress/wordpress-category.html" title="去掉wp分类目录前的category(非插件)">去掉wp分类目录前的category(非插件)</a> (14)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/simple-hezi.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>去掉wp分类目录前的category(非插件)</title>
		<link>http://bulog.org/share/wordpress/wordpress-category.html</link>
		<comments>http://bulog.org/share/wordpress/wordpress-category.html#comments</comments>
		<pubDate>Fri, 26 Feb 2010 10:33:03 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=1172</guid>
		<description><![CDATA[WordPress 的文章分类网址默认显示在 category 父目录下，例如分类名为 wp ，分类链接样式则为 http://blog.com/category/wp。如果后台设置的文章静态链接结构为“/%category%/%postname%.html”，例： http://blog.com/wp/x.html，那么之前的分类链接显得不合逻辑，所有我们希望将它去掉。 对于 wordpress 中的各类问题，几乎都能找到插件解决，这个问题也不例外。但是很大一部分 wper 患有严重的代码控，但凡修改代码可以达到的效果绝不用插件代替，即便后者更为简单。所以在这里介绍一个非插件的方法： 在目录 wp-includes/category-template.php 文件中搜索： $catlink = $wp_rewrite-&#38;gt;get_category_permastruct&#40;&#41;; 在下面添加： $catlink = str_replace&#40;'/category', &#34;&#34;, $catlink&#41;; 保存即可。 今日看点：河南青年看守所内死亡 警方称喝开水后突然发病（网易很知趣，直接关闭评论） 相关日志2010/04/23 -- 滑动关闭侧边栏(基于jQuery1.4) (20)2010/04/22 -- wordpress 默认小工具修改表 (16)2010/03/23 -- 无插件实现 wordpress 彩色标签云效果 (13)2010/03/13 &#8230; <a href="http://bulog.org/share/wordpress/wordpress-category.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress 的文章分类网址默认显示在 category 父目录下，例如分类名为 wp ，分类链接样式则为 http://blog.com/category/wp。如果后台设置的文章静态链接结构为“/%category%/%postname%.html”，例： http://blog.com/wp/x.html，那么之前的分类链接显得不合逻辑，所有我们希望将它去掉。</p>
<p><span id="more-1172"></span>对于 wordpress 中的各类问题，几乎都能找到插件解决，这个问题也不例外。但是很大一部分 wper 患有严重的代码控，但凡修改代码可以达到的效果绝不用插件代替，即便后者更为简单。所以在这里介绍一个非插件的方法：<br />
在目录 <a href="http://bulog.org/share/wordpress/wordpress-category.html">wp-includes/category-template.php</a> 文件中搜索：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$catlink</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_category_permastruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>在下面添加：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$catlink</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/category'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$catlink</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><code>保存即可。</code></p>
<p>今日看点：<a href="http://news.163.com/10/0226/04/60E1A4H60001124J.html" target="_blank">河南青年看守所内死亡 警方称喝开水后突然发病</a>（网易很知趣，直接关闭评论）</p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2011/03/08 -- <a href="http://bulog.org/logs/essay/wen-he.html" title="温和一点">温和一点</a> (13)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/wordpress-category.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>H4主题共享</title>
		<link>http://bulog.org/share/wordpress/theme-h4.html</link>
		<comments>http://bulog.org/share/wordpress/theme-h4.html#comments</comments>
		<pubDate>Thu, 31 Dec 2009 05:25:48 +0000</pubDate>
		<dc:creator>老四</dc:creator>
				<category><![CDATA[WP]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://bulog.org/?p=914</guid>
		<description><![CDATA[主题：H4 版本：1.1 说明：主题基于 mg12 的 inove 修改，dot重新布局演绎，并继续采用“署名-非商业性使用-相同方式共享3.0”协议发布。 功能：增加了留言预览，Ajax评论，优化部分细节增强用户体验。（ajax评论效果默认关闭，如需启用，请参照模板中的说明文档修改） 正如我之前一篇文章所说，站在巨人的肩膀上才能看得更远。所以，无论严格还是不严格的说，H4都只是inove的演绎版。 演示地址：使用H4的朋友可以在此留言，可以把你的博客作为演示 相关日志2010/03/09 -- Simple-hezi（wp主题） (18)2010/04/24 -- 可以这样回到顶部 (13)2010/04/23 -- 滑动关闭侧边栏(基于jQuery1.4) (20)2010/04/22 -- wordpress 默认小工具修改表 (16)2010/03/23 -- 无插件实现 wordpress 彩色标签云效果 (13)2010/03/13 -- 17行代码为 wordpress 添加评论表情列表 (20)]]></description>
			<content:encoded><![CDATA[<p><strong>主题</strong>：<a href=" http://bulog.org/share/wordpress/theme-h4.html">H4</a><br />
<strong> 版本</strong>：1.1<br />
<strong> 说明</strong>：主题基于 mg12 的 inove 修改，dot重新布局演绎，并继续采用“<strong><span style="color: #808000;"><a style="color: #000000; text-decoration: none;" href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank"><span style="font-weight: normal;">署名-非商业性使用-相同方式共享3.0</span></a>”</span></strong>协议发布。</p>
<p><span id="more-914"></span></p>
<p><strong>功能：</strong>增加了留言预览，Ajax评论，优化部分细节增强用户体验。（ajax评论效果默认关闭，如需启用，请参照模板中的说明文档修改）</p>
<p><img class="alignnone" title="h4-1.1" src="http://farm5.static.flickr.com/4059/4229784505_a25861e607_o.jpg" alt="" width="500" height="317" /></p>
<p>正如我之前一篇文章所说，站在巨人的肩膀上才能看得更远。所以，无论严格还是不严格的说，H4都只是inove的演绎版。</p>
<p>演示地址：使用<a href=" http://bulog.org/share/wordpress/theme-h4.html">H4</a>的朋友可以在此留言，可以把你的博客作为演示</p>
<p><a href="http://dotknow.googlecode.com/files/H4.zip" target="_blank"><img class="alignnone" title="下载" src="http://bulog.org/down.gif" alt="下载" width="60" height="20" /></a></p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2010/03/09 -- <a href="http://bulog.org/share/wordpress/simple-hezi.html" title="Simple-hezi（wp主题）">Simple-hezi（wp主题）</a> (18)</li><li>2010/04/24 -- <a href="http://bulog.org/share/wordpress/go-top.html" title="可以这样回到顶部">可以这样回到顶部</a> (13)</li><li>2010/04/23 -- <a href="http://bulog.org/share/wordpress/close-sidebar.html" title="滑动关闭侧边栏(基于jQuery1.4)">滑动关闭侧边栏(基于jQuery1.4)</a> (20)</li><li>2010/04/22 -- <a href="http://bulog.org/share/wordpress/default-widgets.html" title="wordpress 默认小工具修改表">wordpress 默认小工具修改表</a> (16)</li><li>2010/03/23 -- <a href="http://bulog.org/share/wordpress/wordpress-colore-tag.html" title="无插件实现 wordpress 彩色标签云效果">无插件实现 wordpress 彩色标签云效果</a> (13)</li><li>2010/03/13 -- <a href="http://bulog.org/share/wordpress/wordpress-smilies-code.html" title="17行代码为 wordpress 添加评论表情列表">17行代码为 wordpress 添加评论表情列表</a> (20)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://bulog.org/share/wordpress/theme-h4.html/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

