<?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://immmmm.com/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://immmmm.com</link>
	<description>不问明天，悠然浪费</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:43:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress3.3 编辑器自定义按钮添加新方法</title>
		<link>http://immmmm.com/custom-quicktags-into-wordpress-editor.html</link>
		<comments>http://immmmm.com/custom-quicktags-into-wordpress-editor.html#comments</comments>
		<pubDate>Wed, 18 Jan 2012 08:31:36 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[quicktags]]></category>
		<category><![CDATA[WordPress技巧]]></category>
		<category><![CDATA[自定义按钮]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1916</guid>
		<description><![CDATA[Mark文一篇，原文见 @ihacklog 博文（1 &#038; 2）。 如果你使用了WP3.3，即可以用以下方法快捷方便的在后台HTML编辑器中加入自定义按钮，不必再在更新一下在 /wp-includes/js/quicktags.js 动一次手脚咯。 首先创建一个 my-quicktags.js，丢入以下内容： QTags.addButton&#40; '&#60;', '&#60;', '&#38;lt;', '' &#41;; //快捷输入&#60;的html代码 QTags.addButton&#40; '&#62;', '&#62;', '&#38;gt;', '' &#41;; QTags.addButton&#40; 'hr', 'hr', &#34;\n&#60;hr /&#62;\n&#34;, '' &#41;; //快捷输入一个hr横线，点一下即可 QTags.addButton&#40; 'h1', 'h1', &#34;\n&#60;h1&#62;&#34;, &#34;&#60;/h1&#62;\n&#34; &#41;; //快捷输入h1标签 QTags.addButton&#40; 'h2', 'h2', &#34;\n&#60;h2&#62;&#34;, &#34;&#60;/h2&#62;\n&#34; &#41;; QTags.addButton&#40; 'h3', 'h3', &#34;\n&#60;h3&#62;&#34;, &#34;&#60;/h3&#62;\n&#34; &#41;; //QTags.addButton( 'my_id', 'my button', '\n&#60;/span&#62;', [...]]]></description>
			<content:encoded><![CDATA[<p>Mark文一篇，原文见 <a href="http://ihacklog.com/" target="_blank">@ihacklog</a> 博文（<a href="http://ihacklog.com/php/wordpress/wpskills/the-right-way-to-insert-custom-quicktags-into-the-wordpress-editor-revisioned.html" target="_blank">1</a> &#038; <a href="http://ihacklog.com/php/wordpress/wpskills/the-right-way-to-insert-custom-quicktags-into-the-wordpress-editor.html" target="_blank">2</a>）。</p>
<p>如果你使用了WP3.3，即可以用以下方法快捷方便的在后台HTML编辑器中加入自定义按钮，不必再在更新一下在 /wp-includes/js/quicktags.js 动一次手脚咯。</p>
<p>首先创建一个 <code>my-quicktags.js</code>，丢入以下内容：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Microsoft Yahei;">QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'&lt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&lt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;lt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//快捷输入&lt;的html代码</span>
QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'&gt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&gt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'hr'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'hr'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&lt;hr /&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//快捷输入一个hr横线，点一下即可</span>
QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'h1'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'h1'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&lt;h1&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&lt;/h1&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//快捷输入h1标签</span>
QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'h2'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'h2'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&lt;h2&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&lt;/h2&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
QTags.<span style="color: #660066;">addButton</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'h3'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'h3'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&lt;h3&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&lt;/h3&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//QTags.addButton( 'my_id', 'my button', '\n&lt;/span&gt;', '&lt;/span&gt;\n' );  </span>
<span style="color: #006600; font-style: italic;">//这儿共有四对引号，分别是按钮的ID、显示名、点一下输入内容、再点一下关闭内容（此为空则一次输入全部内容），\n表示换行。</span></pre></div></div>

<p><span id="more-1916"></span>然后把此js丢入主题文件夹，再在主题 <code>functions.php</code> 中加入代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #666666; font-style: italic;">// 自定义HTML编辑器按钮</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_quicktags'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_quicktags<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    wp_enqueue_script<span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'my_quicktags'</span><span style="color: #339933;">,</span>
        get_stylesheet_directory_uri<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/my-quicktags.js'</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'quicktags'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>O了，进后台编辑器HTML模式下瞅瞅呗～</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/custom-quicktags-into-wordpress-editor.html/feed</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>WordPress 文章形式之： 聊天</title>
		<link>http://immmmm.com/wordpress-post-format-chat.html</link>
		<comments>http://immmmm.com/wordpress-post-format-chat.html#comments</comments>
		<pubDate>Tue, 17 Jan 2012 15:28:16 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Post Formats]]></category>
		<category><![CDATA[WordPress函数]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1900</guid>
		<description><![CDATA[WordPress3.1 就有的 文章形式（Post Formats） 到现在都3.3了，可完美完全支持的主题依旧屈指可数，至少在国人主题制作圈。 之前自己折腾的主题也是相当受样式限制，溜达 Tumblr 找到现在扒来的这一款，相当霸气外露！ 要想重拾折腾滴基情，换主题决定是首选！间隔如此之久，咱们接着搞 Post Formats 起呗～ 聊天，formats-chat。效果见上文： 《一天》 PHP核心代码如下（基础代码源自 SimpleDark 1.3 ）： //如要使用，请自行去除注释～ &#60;?php $lines = preg_split&#40;&#34;/[\r\n]+/&#34;, $post-&#62;post_content&#41;; //php正则获取每行字符 ?&#62; &#60;?php if&#40;is_array&#40;$lines&#41;&#41; &#123; //建立数组 $i=2; //增加个计数，为对话区分样式 foreach&#40;$lines as $line&#41; &#123; if&#40;trim&#40;$line&#41; != '' &#41; //循环执行，并过来空白行 ?&#62; &#60;p &#60;?php if&#40; $i%2 == 1 &#41;&#123; echo 'class=&#34;even n'.$i.'&#34;';&#125;else &#123;echo 'class=&#34;odd n'.$i.'&#34;';&#125;; [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress3.1 就有的 <a rel="nofollow" href="http://codex.wordpress.org/zh-cn:%E6%96%87%E7%AB%A0%E5%BD%A2%E5%BC%8F" target="_blank">文章形式（Post Formats）</a> 到现在都3.3了，可完美完全支持的主题依旧屈指可数，至少在国人主题制作圈。</p>
<p>之前自己折腾的主题也是相当受样式限制，溜达 <a rel="nofollow" href="http://venicetheme.tumblr.com/" target="_blank">Tumblr</a> 找到现在扒来的这一款，相当霸气外露！</p>
<p>要想重拾折腾滴基情，换主题决定是首选！间隔如此之久，咱们接着搞 <a href="http://immmmm.com/tag/post-formats" target="_blank">Post Formats</a> 起呗～</p>
<p><span id="more-1900"></span><strong>聊天，formats-chat</strong>。效果见上文： <a href="http://immmmm.com/male-student-cao-female-monitor.html" target="_blank">《一天》</a></p>
<p>PHP核心代码如下（基础代码源自 <a href="http://lync.in/simpledark-1-3/" target="_blank">SimpleDark 1.3</a> ）：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;">//如要使用，请自行去除注释～
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$lines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/[<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>]+/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//php正则获取每行字符</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lines</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #666666; font-style: italic;">//建立数组</span>
	<span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//增加个计数，为对话区分样式</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span>   <span style="color: #666666; font-style: italic;">//循环执行，并过来空白行</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;p <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">%</span><span style="color:#800080;">2</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'class=&quot;even n'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'class=&quot;odd n'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;&lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$line</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/p&gt;
	//如果被2除余1添加class=&quot;even n$i&quot;，反之添加class=&quot;odd n$i&quot;，接着输出每行内容。
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这儿我新增了计数$i，一是判断聊天奇偶，另外是隐藏部分对话。</p>
<p>接着上CSS核心代码：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:Microsoft Yahei;"><span style="color: #6666ff;">.home</span> <span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.home</span> <span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.even</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.archive</span> <span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.archive</span> <span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.even</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span><span style="color: #6666ff;">.n2</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span><span style="color: #6666ff;">.n4</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span><span style="color: #6666ff;">.n6</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.even</span><span style="color: #6666ff;">.n3</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.even</span><span style="color: #6666ff;">.n5</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* 默认把聊天对话给隐藏，然后把前5句显示出来 */</span>
<span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.odd</span> span<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>background<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#66bcc5</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.format-chat</span> <span style="color: #6666ff;">.even</span> span<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span> <span style="color: #933;">40px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>background<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#BDC866</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* 样式的主要区分就是这2个咯 */</span></pre></div></div>

<p>然后，没然后了。写文章时选中”聊天“形式，每一行即一个人说的话。</p>
<p>懂也好不懂也好，个人认为这PHP代码还是值得Mark，SO，自我多情一个就分享咯～</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/wordpress-post-format-chat.html/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>OptimusV2.0.12</title>
		<link>http://immmmm.com/optimus-update-to-2012.html</link>
		<comments>http://immmmm.com/optimus-update-to-2012.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 10:59:29 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Optimus]]></category>
		<category><![CDATA[WordPress主题]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1881</guid>
		<description><![CDATA[OptimusV2.0.12.zip更新完毕，更改内容大概如下： 加入jQuery：Ajax评论提交，双击快捷回复/取消回复，slimbox2图片灯箱特效；集成表情一套；主题边框细节已更改，头像放于右侧，加入一些小透明。其它也没其它了貌似，各位看官随意自取～ （点标题直接下了哦～）]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="https://dl.dropbox.com/u/837457/mytheme/OptimusV2.0.12.zip" target="_blank">OptimusV2.0.12.zip</a>更新完毕，更改内容大概如下：</p>
<p>加入jQuery：Ajax评论提交，双击快捷回复/取消回复，slimbox2图片灯箱特效；集成表情一套；主题边框细节已更改，头像放于右侧，加入一些小透明。其它也没其它了貌似，各位看官随意自取～</p>
<p>（点标题直接下了哦～）</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/optimus-update-to-2012.html/feed</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>折腾，需要理由吗？</title>
		<link>http://immmmm.com/no-reason-for-modify-themes.html</link>
		<comments>http://immmmm.com/no-reason-for-modify-themes.html#comments</comments>
		<pubDate>Sat, 03 Dec 2011 16:40:52 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[双击事件]]></category>
		<category><![CDATA[评论]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1864</guid>
		<description><![CDATA[一晃十二月，FF8下主题文字文章变白的BUG实在是看不下去了。另外，这月将是一场攻坚战，真正意义上的检测：期末考试。SO，此周不折腾更待何时！ 主题样式上就把边栏放右边了，此次折腾主要是加入了jQuery，因为这货折腾起来爽撒撒！！ 1.Slimbox2的图片特效，这个可以有： if&#40;$&#40;'.postContent a[rel!=link]:has(img)'&#41;.length &#62; 0&#41;&#123; //判断文章内容区域是否有链接大图的图片，有则： $.getScript&#40;&#34;&#60;?php bloginfo('template_url'); ?&#62;/js/slimbox2.js&#34;&#41;; //动态加载图片特效的js。 //此处有点作，一个判断只为省下4KB的加载。 &#125;; 2.Ajax评论提交，这个必须有： 虽说这对博主来说没啥大关系，一般咱都是后台直接回复评论的，反正后台是Ajax的，管他前台呢～一直认为，木有集成Ajax评论提交的主题都是不负责任。现在我想负起来了，就加呗！ 实现方法当然还是依旧使用牛XX的Willin大师出品，不过适当的改进还是可以有滴～ 比如说，加个新评论提交“双击再编辑”：新评论提交后，突然发现想加个YD的表情？耶，试试双击它～ 额，有突然不想加了……那就点击“取消编辑”呗～ $&#40;'#comments .live'&#41;.live&#40;'dblclick',function&#40;&#41;&#123;$&#40;this&#41;.next&#40;&#41;.children&#40;'a'&#41;.click&#40;&#41;&#125;&#41;; //其实偶就是把那个编辑的链接隐藏了，然后以双击模拟点击，够XD吧～ 3.Ctrl+Enter快捷提交，这个当然有： $&#40;'textarea'&#41;.keypress&#40;function&#40;e&#41;&#123; if&#40;e.ctrlKey &#38;&#38; e.which == 13 &#124;&#124; e.which == 10&#41; &#123; $&#40;this&#41;.parent&#40;&#41;.submit&#40;&#41;; &#125; &#125;&#41;; 4.评论部分双击事件，这个偷偷有： 双击某条评论，快捷回复；再双击，取消回复此人。 $&#40;'#comments .comment-body'&#41;.dblclick&#40;function&#40;&#41;&#123; //其实也就是用双击事件来模拟用户点击那个“回复”链接的点击事件～ var crl=$&#40;'#cancel-comment-reply-link'&#41;; if&#40;$&#40;this&#41;.next&#40;'#respond'&#41;.length &#62; 0&#41; &#123; crl.click&#40;&#41; &#125;else&#123; $&#40;this&#41;.find&#40;'.comment-reply-link'&#41;.click&#40;&#41;; crl.text&#40;&#34;取消 @&#34;+$&#40;this&#41;.find&#40;'.name'&#41;.text&#40;&#41;&#41;; //上句一个小功能，显示是@回复谁滴～ &#125; [...]]]></description>
			<content:encoded><![CDATA[<p>一晃十二月，FF8下主题文字文章变白的BUG实在是看不下去了。另外，这月将是一场攻坚战，真正意义上的检测：期末考试。SO，此周不折腾更待何时！</p>
<p>主题样式上就把边栏放右边了，此次折腾主要是加入了jQuery，因为这货折腾起来爽撒撒！！</p>
<p><span style="color: #36f;"><strong>1.Slimbox2的图片特效，这个可以有：</strong></span><span id="more-1864"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Microsoft Yahei;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.postContent a[rel!=link]:has(img)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">//判断文章内容区域是否有链接大图的图片，有则：</span>
	$.<span style="color: #660066;">getScript</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;?php bloginfo('template_url'); ?&gt;/js/slimbox2.js&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//动态加载图片特效的js。</span>
	<span style="color: #006600; font-style: italic;">//此处有点作，一个判断只为省下4KB的加载。</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="color: #36f;"><strong>2.Ajax评论提交，这个必须有：</strong></span></p>
<p>虽说这对博主来说没啥大关系，一般咱都是后台直接回复评论的，反正后台是Ajax的，管他前台呢～一直认为，木有集成Ajax评论提交的主题都是不负责任。现在我想负起来了，就加呗！</p>
<p>实现方法当然还是依旧使用牛XX的Willin大师出品，不过适当的改进还是可以有滴～</p>
<p style="text-align: center;"><a href="http://img1.dnschina.net/files/46/immmmm/201112/dbck2.jpg"><img  alt="" src="http://img1.dnschina.net/files/46/immmmm/201112/dbck2.jpg" title=""></a></p>
<p>比如说，加个新评论提交“双击再编辑”：新评论提交后，突然发现想加个YD的表情？耶，试试双击它～</p>
<p style="text-align: center;"><a href="http://img1.dnschina.net/files/46/immmmm/201112/dbck3jpg"><img  alt="" src="http://img1.dnschina.net/files/46/immmmm/201112/dbck3.jpg" title=""></a></p>
<p>额，有突然不想加了……那就点击“取消编辑”呗～</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Microsoft Yahei;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#comments .live'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'dblclick'</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//其实偶就是把那个编辑的链接隐藏了，然后以双击模拟点击，够XD吧～</span></pre></div></div>

<p><span style="color: #36f;"><strong>3.Ctrl+Enter快捷提交，这个当然有：</strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Microsoft Yahei;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">ctrlKey</span> <span style="color: #339933;">&amp;&amp;</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span> <span style="color: #339933;">||</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="color: #36f;"><strong>4.评论部分双击事件，这个偷偷有：</strong></span></p>
<p style="text-align: center;"><a href="http://img1.dnschina.net/files/46/immmmm/201112/dbck1.jpg"><img  alt="" src="http://img1.dnschina.net/files/46/immmmm/201112/dbck1.jpg" title=""></a></p>
<p>双击某条评论，快捷回复；再双击，取消回复此人。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Microsoft Yahei;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#comments .comment-body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dblclick</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: #006600; font-style: italic;">//其实也就是用双击事件来模拟用户点击那个“回复”链接的点击事件～</span>
	<span style="color: #003366; font-weight: bold;">var</span> crl<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cancel-comment-reply-link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#respond'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		crl.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.comment-reply-link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		crl.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;取消 @&quot;</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.name'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">//上句一个小功能，显示是@回复谁滴～</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="color: #36f;"><strong>5.暂时木有了……</strong></span></p>
<p>擦，0:38，我去去！</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/no-reason-for-modify-themes.html/feed</wfw:commentRss>
		<slash:comments>83</slash:comments>
		</item>
		<item>
		<title>Optimus（V2.0.11）放出</title>
		<link>http://immmmm.com/wordpress-theme-optimus-share.html</link>
		<comments>http://immmmm.com/wordpress-theme-optimus-share.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 14:39:00 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Optimus]]></category>
		<category><![CDATA[WordPress主题]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1817</guid>
		<description><![CDATA[Optimus（V2.0.11） 感谢 @蓝X冰 整理，此主题仅为测试主题，实属三无（无产权无版权无认证，瞎扯的！）产品，非折腾帝莫用～]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Optimus" href="http://115.com/file/aqkxzt74#">Optimus（V2.0.11）</a></p>
<p>感谢 @蓝X冰 整理，此主题仅为测试主题，实属三无（无产权无版权无认证，瞎扯的！）产品，非折腾帝莫用～</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/wordpress-theme-optimus-share.html/feed</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
		<item>
		<title>尝试 Feedburner 败之</title>
		<link>http://immmmm.com/try-with-feedburner.html</link>
		<comments>http://immmmm.com/try-with-feedburner.html#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:11:36 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[订阅]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1804</guid>
		<description><![CDATA[貌似很早很早就用Feedsky来做feed输出了，而且也做了二级域名绑定： http://feed.immmmm.com，可最新sky是越来越疲软，更新推送少则半天多则数天，甚则莫名给你不更新几天！ 独立博客，个人一直认为订阅数及评论数才是最关键的2个数值！一个博客，没看客没评论，我想多少会有些寂寥。至于IP、PR、外链等则是衡量网站的指标，个人博客无需在乎那么多。像这儿平常日IP你觉得有多少？ 是的，就300而已。当然有时高有时低，整体来说这一年平均日IP也就300～ 说回订阅，sky既然这么疲软，那想试试 fb（feedburner简称一下）。在fb未被Google收购、功夫网认证前折腾过，此次折腾也只为它的即时稳定！ 一下下很快 Feedburner 订阅地址： http://feeds.feedburner.com/linmumu，然后绑定子域名feed，加cname等待，save多次出门填肚子归来终于O了。 可可，竟竟然绑定域名只能做到这样： http://feed.immmmm.com/linmumu，访问： http://feed.immmmm.com/ 是进入管理界面。坑爹啊这是！！！ 我这这800多号童鞋可都靠着这个呢，竟然@#￥%……&#038; 之后网上又好好查了查，CP后台的可以用子域名单独绑定wp-rss2.php切换到本地，咱DA的伤不起，htaccess跳转代码貌似测试也行不通。 哎，国庆折腾到此为了，明儿被安排到值班早8点～12点，变身！]]></description>
			<content:encoded><![CDATA[<p>貌似很早很早就用Feedsky来做feed输出了，而且也做了二级域名绑定：  <a href="http://feed.immmmm.com" target="_blank"><span style="color: #36f;"><strong>http://feed.immmmm.com</strong></span></a>，可最新sky是越来越疲软，更新推送少则半天多则数天，甚则莫名给你不更新几天！</p>
<p>独立博客，个人一直认为订阅数及评论数才是最关键的2个数值！一个博客，没看客没评论，我想多少会有些寂寥。至于IP、PR、外链等则是衡量网站的指标，个人博客无需在乎那么多。像这儿平常日IP你觉得有多少？<span id="more-1804"></span></p>
<p style="text-align:center;"><img src="http://img1.dnschina.net/files/46/immmmm/201110/day_ip.jpg" alt="day_ip.jpg" /></p>
<p>是的，就300而已。当然有时高有时低，整体来说这一年平均日IP也就300～</p>
<p>说回订阅，sky既然这么疲软，那想试试 fb（feedburner简称一下）。在fb未被Google收购、功夫网认证前折腾过，此次折腾也只为它的即时稳定！</p>
<p>一下下很快 Feedburner 订阅地址： <a href="http://feeds.feedburner.com/linmumu" target="_blank"><span style="color: #36f;"><strong>http://feeds.feedburner.com/linmumu</strong></span></a>，然后绑定子域名feed，加cname等待，save多次出门填肚子归来终于O了。</p>
<p>可可，竟竟然绑定域名只能做到这样： http://feed.immmmm.com/linmumu，访问： http://feed.immmmm.com/ 是进入管理界面。坑爹啊这是！！！</p>
<p style="text-align:center;"><img src="http://img1.dnschina.net/files/46/immmmm/201110/feed.jpg" alt="feed.jpg" /></p>
<p>我这这800多号童鞋可都靠着这个呢，竟然@#￥%……&#038;</p>
<p>之后网上又好好查了查，CP后台的可以用子域名单独绑定wp-rss2.php切换到本地，咱DA的伤不起，htaccess跳转代码貌似测试也行不通。</p>
<p>哎，国庆折腾到此为了，明儿被安排到值班早8点～12点，变身！</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/try-with-feedburner.html/feed</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
		<item>
		<title>WordPress主题：Optimus</title>
		<link>http://immmmm.com/wordpress-theme-optimus.html</link>
		<comments>http://immmmm.com/wordpress-theme-optimus.html#comments</comments>
		<pubDate>Sun, 02 Oct 2011 14:53:10 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Optimus]]></category>
		<category><![CDATA[WordPress主题]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1789</guid>
		<description><![CDATA[115下载：Optimus（V2.0.11） 2011-10-08：感谢 @蓝X冰 整理，此主题仅为测试主题，实属三无（无产权无版权无认证，瞎扯的！）产品，非折腾帝莫用～ 吼哈！新主题上线也～ 下午终于忍不住在新本本上搭建起了本地php环境，本想基于 ProwerV4 改改单栏，可首页文章样式不好调。然后就到 Tunmblr 找啊找啊，选中了 Optimus！ 索性直接就用V4改样式了， 反正 @摄氏度 童鞋写得也很规范简洁，之后就改啊改啊，貌似差不多除了主循环内置函数其它都重写了……这样也好，省去了不少一个个在帮助手册查函数、一个个新建php文件的时间！ 然后首页、文章页、评论、归档页样式，functions功能，晚上6点半就上线初步版本了。然然后大干WordPress文章样式，日志、相册、照片、对话等等等等，刚又添加了表情，完善了几处小错位，就此基本O了！ 看来俺还是宝刀未老啊，数月未碰代码，干起来相当得有劲！要有多爽有多爽，那俗话，小别胜啥来着？吼吼！ 哦，另外这个主题我想自个儿YY一周，等假期前再看看是否分享或私藏～ ^ ^ 各位管人别急哦～急了可以先去找找 虾子酱 搞个小基啥的，恩哈～]]></description>
			<content:encoded><![CDATA[<div class="player"><embed class="mp3_player" src="http://immmmm.com/wp-content/themes/Venice/audio_player.swf?audio_file=http://storage.live.com/items/6E6B92BD0BA88634!208?filename=MY%20LOVE.mp3&color=FFFFFF" width="207" height="60" type="application/x-shockwave-flash"></embed></div>
<p style="text-align: center;">115下载：<a href="http://115.com/file/aqkxzt74#" title="Optimus">Optimus</a>（V2.0.11）</p>
<p>2011-10-08：感谢 @蓝X冰 整理，此主题仅为测试主题，实属三无（无产权无版权无认证，瞎扯的！）产品，非折腾帝莫用～</p>
<p>吼哈！新主题上线也～<span id="more-1789"></span></p>
<p>下午终于忍不住在新本本上搭建起了本地php环境，本想基于 <a href="http://www.prower.cn/work/2097" target="_blank">ProwerV4</a> 改改单栏，可首页文章样式不好调。然后就到 Tunmblr 找啊找啊，选中了 <a href="http://www.tumblr.com/theme/6473" rel="nofollow" target="_blank">Optimus</a>！</p>
<p>索性直接就用V4改样式了， 反正 <a href="http://www.prower.cn" target="_blank">@摄氏度</a> 童鞋写得也很规范简洁，之后就改啊改啊，貌似差不多除了主循环内置函数其它都重写了……这样也好，省去了不少一个个在帮助手册查函数、一个个新建php文件的时间！</p>
<p>然后首页、文章页、评论、归档页样式，functions功能，晚上6点半就上线初步版本了。然然后大干WordPress文章样式，日志、相册、照片、对话等等等等，刚又添加了表情，完善了几处小错位，就此基本O了！</p>
<p>看来俺还是宝刀未老啊，数月未碰代码，干起来相当得有劲！要有多爽有多爽，那俗话，小别胜啥来着？吼吼！</p>
<p>哦，另外这个主题我想自个儿YY一周，等假期前再看看是否分享或私藏～ ^ ^</p>
<p>各位管人别急哦～急了可以先去找找 <a href="http://xiazi.info/archives/genuine-admit.html" target="_blank">虾子酱</a> 搞个小基啥的，恩哈～</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/wordpress-theme-optimus.html/feed</wfw:commentRss>
		<slash:comments>146</slash:comments>
<enclosure url="http://storage.live.com/items/6E6B92BD0BA88634!208?filename=MY%20LOVE.mp3" length="" type="9743770" />
		</item>
		<item>
		<title>WordPress 文章形式之： 相册</title>
		<link>http://immmmm.com/wordpress-post-format-gallery.html</link>
		<comments>http://immmmm.com/wordpress-post-format-gallery.html#comments</comments>
		<pubDate>Sun, 18 Sep 2011 09:12:47 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Post Formats]]></category>
		<category><![CDATA[WordPress函数]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1756</guid>
		<description><![CDATA[文章页的相册显示，WP后台编辑器就OK，可首页也想显示成相册模式呢？ 效果截图： 丢下面代码到首页相册形式的文章循环内： &#60;?php echo do_shortcode&#40;''&#41;; ?&#62; 这样WP会自动调取文章内的相册图片，显示方式为：三列，缩略图（后台设置的），链接到图片。 这儿也得解决一个问题，WP会自动插入一段css来控制相册的显示，果断干掉之！丢以下代码至functions： // 去除默认相册样式 add_filter&#40; 'use_default_gallery_style', '__return_false' &#41;; 然后自己加样式，如： .gallery-size-thumbnail .gallery-item&#123;float:left;margin-top:10px;text-align:center;width:33%;&#125; .gallery-size-thumbnail img&#123;width:128px;height:128px;&#125; 需了解更多用法，移步官方文档（ Gallery Shortcode ）。]]></description>
			<content:encoded><![CDATA[<p>文章页的相册显示，WP后台编辑器就OK，可首页也想显示成相册模式呢？</p>
<p>效果截图：</p>
<p style="text-align: center;"><img src="http://img1.dnschina.net/files/46/immmmm/201109/xc.jpg" alt="xc.jpg" /></p>
<p>丢下面代码到首页相册形式的文章循环内：<span id="more-1756"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> do_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[gallery columns=&quot;3&quot; size=&quot;thumbnail&quot; link=&quot;file&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这样WP会自动调取文章内的相册图片，显示方式为：三列，缩略图（后台设置的），链接到图片。</p>
<p>这儿也得解决一个问题，WP会自动插入一段css来控制相册的显示，果断干掉之！丢以下代码至functions：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;"><span style="color: #666666; font-style: italic;">// 去除默认相册样式</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'use_default_gallery_style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'__return_false'</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="css" style="font-family:Microsoft Yahei;"><span style="color: #6666ff;">.gallery-size-thumbnail</span> <span style="color: #6666ff;">.gallery-item</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>margin-<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">33%</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.gallery-size-thumbnail</span> img<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">128px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">128px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>需了解更多用法，移步官方文档（ <a href="http://codex.wordpress.org/Gallery_Shortcode" rel="nofollow" target="_blank">Gallery Shortcode</a> ）。</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/wordpress-post-format-gallery.html/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>WordPress 文章形式之： 图像</title>
		<link>http://immmmm.com/wordpress-post-format-image.html</link>
		<comments>http://immmmm.com/wordpress-post-format-image.html#comments</comments>
		<pubDate>Sun, 18 Sep 2011 08:06:56 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>
		<category><![CDATA[Post Formats]]></category>
		<category><![CDATA[WordPress函数]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1750</guid>
		<description><![CDATA[继续 《WordPress 文章形式小议》 ，这次说说单张图片的展示！ 很早很早，WordPress就来了个“特色图像”（ add_theme_support( 'post-thumbnails' ); ），简单来说就是：通过WP后台上传的图片，首页调用显示该图片的缩略图。 可这个缩略图的大小怎么设置成自己想要的呢？比如我想显示420×280大小的，怎么设置？ WordPress自带有个：后台-设置-图像大小-缩略图大小，宽度，高度。可里面直接填420、280，然后文章里上传图片，你会发现裁剪和显示都有问题，图片要不没头要不没腰。那怎么办呢？还有，如果我需要生成多个不同大小的缩略图呢？ 看官方文档，有这么个函数 add image size() 是自定义生成指定大小的缩略图。 functions.php里没问题，加上： &#160; // 特色图片 &#160; add_theme_support&#40; 'post-thumbnails' &#41;; &#160; add_image_size&#40; 'home-tb', 420, 280, true&#41;; //加true是严格裁剪模式 生成木有问题，问题在显示，按照官方调取函数应该这么写： &#160; &#60;?php the_post_thumbnail&#40; 'home-tb' &#41;; ?&#62; 可这样硬是不给你420×280的缩略图！！！后来，请教了 bolo ，他说WP傻，一定得用数组它才认得！得改成这样，直接用数组写死： &#160; &#60;?php the_post_thumbnail&#40;array&#40;420,280&#41;&#41;; ?&#62; 其实呢，按道理2个函数都是行得通的都可以的，可WP就是不认第一个…… 这个问题很早就发现也很早就解决了，时间精力关系到现在才码出来给各位参考，以上具体相关问题得童鞋们自行测试了才会明白！另外，我也不晓得现在主流获取指定大小特色图片是怎么来处理的，都靠那个被曝严重漏洞的thmb？？.php??既然WP自带函数能解决，当然还是用自带的咯，而且也够用！ 解决了以上这个问题，咱们文章形式“图像”就没有技术障碍了：functions里指定裁剪大小（可多个），后台上传图片WP自动裁剪，想显示的地方插入调取不同大小的数组函数～ PS：很久没折腾了，靠着回忆，思路有些紊乱，请童鞋们见谅了～]]></description>
			<content:encoded><![CDATA[<p>继续 <a href="http://immmmm.com/wordpress-post-formats.html" target="_blank">《WordPress 文章形式小议》</a> ，这次说说单张图片的展示！</p>
<p>很早很早，WordPress就来了个“特色图像”（ <code>add_theme_support( 'post-thumbnails' );</code> ），简单来说就是：通过WP后台上传的图片，首页调用显示该图片的缩略图。</p>
<p>可这个缩略图的大小怎么设置成自己想要的呢？比如我想显示420×280大小的，怎么设置？<span id="more-1750"></span></p>
<p>WordPress自带有个：后台-设置-图像大小-缩略图大小，宽度，高度。可里面直接填420、280，然后文章里上传图片，你会发现裁剪和显示都有问题，图片要不没头要不没腰。那怎么办呢？还有，如果我需要生成多个不同大小的缩略图呢？</p>
<p>看官方文档，有这么个函数 <a rel="nofollow" href="http://codex.wordpress.org/Function_Reference/add_image_size" target="_blank">add image size()</a>  是自定义生成指定大小的缩略图。</p>
<p>functions.php里没问题，加上：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;">&nbsp;
<span style="color: #666666; font-style: italic;">// 特色图片</span>
&nbsp;
add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
add_image_size<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'home-tb'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">420</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">280</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//加true是严格裁剪模式</span></pre></div></div>

<p>生成木有问题，问题在显示，按照官方调取函数应该这么写：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'home-tb'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>可这样硬是不给你420×280的缩略图！！！后来，请教了 bolo ，他说WP傻，一定得用数组它才认得！得改成这样，直接用数组写死：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Microsoft Yahei;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">420</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">280</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>其实呢，按道理2个函数都是行得通的都可以的，可WP就是不认第一个……</p>
<p>这个问题很早就发现也很早就解决了，时间精力关系到现在才码出来给各位参考，以上具体相关问题得童鞋们自行测试了才会明白！另外，我也不晓得现在主流获取指定大小特色图片是怎么来处理的，都靠那个被曝严重漏洞的thmb？？.php??既然WP自带函数能解决，当然还是用自带的咯，而且也够用！</p>
<p>解决了以上这个问题，咱们文章形式“图像”就没有技术障碍了：functions里指定裁剪大小（可多个），后台上传图片WP自动裁剪，想显示的地方插入调取不同大小的数组函数～</p>
<p>PS：很久没折腾了，靠着回忆，思路有些紊乱，请童鞋们见谅了～</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/wordpress-post-format-image.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>换主机商了</title>
		<link>http://immmmm.com/host-changed.html</link>
		<comments>http://immmmm.com/host-changed.html#comments</comments>
		<pubDate>Sun, 04 Sep 2011 15:23:06 +0000</pubDate>
		<dc:creator>林木木</dc:creator>
				<category><![CDATA[折腾无休]]></category>

		<guid isPermaLink="false">http://immmmm.com/?p=1723</guid>
		<description><![CDATA[RT]]></description>
			<content:encoded><![CDATA[<p>RT</p>
]]></content:encoded>
			<wfw:commentRss>http://immmmm.com/host-changed.html/feed</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
	</channel>
</rss>

