<?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>Leon&#039;s blog &#187; Wordpress</title>
	<atom:link href="http://www.leonzhang.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leonzhang.com</link>
	<description>关注: 开源&#38;互联网, GTD with open source and Web</description>
	<lastBuildDate>Mon, 30 Jan 2012 14:24:13 +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>WordPress Google Map ShortCode</title>
		<link>http://www.leonzhang.com/2010/01/22/wordpress-google-map-shortcode/</link>
		<comments>http://www.leonzhang.com/2010/01/22/wordpress-google-map-shortcode/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 05:26:40 +0000</pubDate>
		<dc:creator>leon</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[GoogleMap]]></category>

		<guid isPermaLink="false">http://www.leonzhang.com/?p=394</guid>
		<description><![CDATA[ShortCode是WordPress扩展其编辑器的快捷方式，能快速的实现一些常用的插入功能。 比如，你要经常在blog里贴程序代码，SyntaxHighlighter这个插件就提供了插入代码的ShortCode。 自己写一些常用的ShortCode也很简单，有人以Google Map为例，做了个示例。 在模板functions.php文件里加入下列php代码： 然后在编辑框里输入&#91;googlemap width=”600&#8243; height=”400&#8243; src=”url”&#93; 就能显示Google Map了。这里的url，就是你在Google Map网站上看地图时右上角的那个Link对话框了的Link。 下面是上海万体馆附近的地图。 [googlemap width="600" height="400" src="http://maps.google.com/maps?ie=UTF8&#038;hq=&#038;hnear=Shanghai,+China&#038;ll=31.18237,121.432829&#038;spn=0.015016,0.017617&#038;t=h&#038;z=16"] 你也可以在地铁上加上自己的数据，这是上海的一些KFC店。 [googlemap width="600" height="400" src="http://maps.google.com/maps/ms?ie=UTF8&#038;hl=en&#038;msa=0&#038;msid=116975913023088085964.00047db7d38369561466d&#038;t=h&#038;z=12"] 当然你也可以直接用Google Map自己提供的iframe代码了，只是稍微长了点。]]></description>
			<content:encoded><![CDATA[<p><a href="http://codex.wordpress.org/Shortcode_API">ShortCode</a>是WordPress扩展其编辑器的快捷方式，能快速的实现一些常用的插入功能。</p>
<p>比如，你要经常在blog里贴程序代码，<a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>这个插件就提供了插入代码的<a href="http://codex.wordpress.org/Shortcode_API">ShortCode</a>。</p>
<p>自己写一些常用的<a href="http://codex.wordpress.org/Shortcode_API">ShortCode</a>也很简单，有人以<a href="http://map.google.com">Google Map</a>为例，做了个<a href="http://www.stumbleupon.com/su/2yLUar/digwp.com/2010/01/google-maps-shortcode/">示例</a>。<br />
在模板functions.php文件里加入下列php代码：<br />
<span id="more-394"></span></p>
<pre class="brush: php; title: ; notranslate">
//Google Maps Shortcode
function fn_googleMaps($atts, $content = null) {
   extract(shortcode_atts(array(
      &quot;width&quot; =&gt; '640',
      &quot;height&quot; =&gt; '480',
      &quot;src&quot; =&gt; ''
   ), $atts));
   return '&lt;iframe width=&quot;'.$width.'&quot; height=&quot;'.$height.'&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;'.$src. '&amp;amp;output=embed&quot; &gt;&lt;/iframe&gt;';
}
add_shortcode(&quot;google map&quot;, &quot;fn_googleMaps&quot;);
</pre>
<p>然后在编辑框里输入&#91;googlemap width=”600&#8243; height=”400&#8243; src=”url”&#93;<br />
就能显示<a href="http://map.google.com">Google Map</a>了。这里的url，就是你在<a href="http://map.google.com">Google Map</a>网站上看地图时右上角的那个Link对话框了的Link。</p>
<p>下面是上海万体馆附近的地图。<br />
[googlemap width="600" height="400" src="http://maps.google.com/maps?ie=UTF8&#038;hq=&#038;hnear=Shanghai,+China&#038;ll=31.18237,121.432829&#038;spn=0.015016,0.017617&#038;t=h&#038;z=16"]</p>
<p>你也可以在地铁上加上自己的数据，这是上海的一些KFC店。<br />
[googlemap width="600" height="400" src="http://maps.google.com/maps/ms?ie=UTF8&#038;hl=en&#038;msa=0&#038;msid=116975913023088085964.00047db7d38369561466d&#038;t=h&#038;z=12"]</p>
<p>当然你也可以直接用<a href="http://map.google.com">Google Map</a>自己提供的iframe代码了，只是稍微长了点。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;iframe width=&quot;600&quot; height=&quot;400&quot; frameborder=&quot;0&quot;
scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;
src=&quot;http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;msa=0&amp;amp;msid=116975913023088085964.00047db7d38369561466d&amp;amp;ll=31.236635,121.465941&amp;amp;spn=0.104698,0.152156&amp;amp;t=h&amp;amp;output=embed&quot;&gt;
&lt;/iframe&gt;
&lt;br /&gt;&lt;small&gt;View
&lt;a href=&quot;http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;msa=0&amp;amp;msid=116975913023088085964.00047db7d38369561466d&amp;amp;ll=31.236635,121.465941&amp;amp;spn=0.104698,0.152156&amp;amp;t=h&amp;amp;source=embed&quot; style=&quot;color:#0000FF;text-align:left&quot;&gt;
上海 KFC店&lt;/a&gt; in a larger map&lt;/small&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leonzhang.com/2010/01/22/wordpress-google-map-shortcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avatar, ps WordPress Avatar</title>
		<link>http://www.leonzhang.com/2010/01/21/avatar-ps-wordpress-avatar/</link>
		<comments>http://www.leonzhang.com/2010/01/21/avatar-ps-wordpress-avatar/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 06:13:26 +0000</pubDate>
		<dc:creator>leon</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.leonzhang.com/?p=389</guid>
		<description><![CDATA[Avatar，此Avatar非彼Avatar，不是电影啦，是wordpress回复的的头像。 我看别人的blog的时候，看到回复里的人都有头像，但是我的blog里却不会，一直觉的很奇怪。Google了一下，看到wordpress从2.5开始就支持使用Gravatar了呀。我的blog虽然升级不怎么及时，却也是2.8的啦。怎么回事呢？ 再Google，原来是我使用的这个theme不太好，大概用这个theme的时候wordpress还没支持avatar功能。这个theme的comments.php里是一项项写死的，而不是用wordpress的wp_list_comments()方法。 那就简单了，把这个theme的comments.php里关于显示回复的那段代码替换下就行了。 之前的代码： 替换成：]]></description>
			<content:encoded><![CDATA[<p>Avatar，<a href="http://codex.wordpress.org/Using_Gravatars">此Avatar</a>非<a href="http://www.douban.com/subject/1652587/">彼Avatar</a>，不是电影啦，是wordpress回复的的头像。<br />
我看别人的blog的时候，看到回复里的人都有头像，但是我的blog里却不会，一直觉的很奇怪。Google了一下，看到wordpress从2.5开始就支持使用<a href="http://www.gravatar.com">Gravatar</a>了呀。我的blog虽然升级不怎么及时，却也是2.8的啦。怎么回事呢？<br />
再Google，原来是我使用的这个theme不太好，大概用这个theme的时候wordpress还没支持avatar功能。这个theme的comments.php里是一项项写死的，而不是用wordpress的wp_list_comments()方法。<br />
那就简单了，把这个theme的comments.php里关于显示回复的那段代码替换下就行了。<br />
<span id="more-389"></span><br />
之前的代码：</p>
<pre class="brush: php; title: ; notranslate">
	&lt;ol class=&quot;commentlist&quot;&gt;

	&lt;?php foreach ($comments as $comment) : ?&gt;

		&lt;li class=&quot;&lt;?php echo $oddcomment; ?&gt;&quot; id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;
			&lt;?php comment_author_link() ?&gt; Says:
			&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
			Your comment is awaiting moderation.
			&lt;?php endif; ?&gt;
			&lt;br /&gt;
			&lt;?php comment_text() ?&gt;
		&lt;p class=&quot;commentmetadata&quot;&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('e','',''); ?&gt;&lt;/p&gt;
		&lt;/li&gt;

	&lt;?php /* Changes every other comment to a different class */
		if ('alt' == $oddcomment) $oddcomment = '';
		else $oddcomment = 'alt';
	?&gt;

	&lt;?php endforeach; /* end for each comment */ ?&gt;

	&lt;/ol&gt;
</pre>
<p>替换成：</p>
<pre class="brush: php; title: ; notranslate">
	&lt;ol class=&quot;commentlist&quot;&gt;
	&lt;?php wp_list_comments(); ?&gt;
	&lt;/ol&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leonzhang.com/2010/01/21/avatar-ps-wordpress-avatar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 1/15 queries in 0.009 seconds using disk: basic
Object Caching 353/377 objects using disk: basic
Content Delivery Network via N/A

Served from: www.leonzhang.com @ 2012-02-10 17:41:56 -->
