<?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>mitcho.com &#187; WordPress</title>
	<atom:link href="http://mitcho.com/blog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 23:24:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>The next generation of related posts: announcing the YARPP-BlogGlue partnership</title>
		<link>http://mitcho.com/blog/projects/yarpp-blogglue/</link>
		<comments>http://mitcho.com/blog/projects/yarpp-blogglue/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 20:33:23 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[BlogGlue]]></category>
		<category><![CDATA[related posts]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/?p=4498</guid>
		<description><![CDATA[On January 2nd, 2008, from the rural town in eastern Taiwan where I was then working, I committed version 1.0 of the Yet Another Related Posts Plugin (YARPP) to the WordPress plugins repository. Since then, YARPP has been downloaded almost one million times and has evolved greatly. It also has been the impetus for my [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://mitcho.com/blog/wp-content/uploads/2011/06/yarpp-blogglue.png" alt="YARPP hearts BlogGlue" border="0" width="322" height="54" /></center></p>

<p>On January 2nd, 2008, from the rural town in eastern Taiwan where I was then working, I committed version 1.0 of the <a href="http://www.yarpp.org">Yet Another Related Posts Plugin (YARPP)</a> to the WordPress plugins repository. Since then, YARPP has been downloaded almost one million times and has evolved greatly. It also has been the impetus for my further involvement in the <a href="http://wordpress.org">WordPress</a> open source community.</p>

<p>I believe the success of YARPP comes from its simple premise: <strong>display related content to visitors and they will stay on your site longer</strong>. Your visitors learn more about you and they in turn find more compelling content that they&#8217;re interested in.</p>

<p>One oft requested feature for YARPP has been the ability to display related posts from across multiple sites. I&#8217;ve thought about what this would involve technically—the infrastructure, the algorithms, the queries—and have chosen not to go down this route. To do so would require a serious investment of time and resources, which doesn&#8217;t make sense for me as I continue to be in grad school.</p>

<p>In January, though, I met the team at <a href="http://blogglue.com">BlogGlue</a> while in Phoenix for <a href="http://phxwordcamp.com/">WordCamp Phoenix</a>. It was refreshing to meet a team who has really thought through the technical aspects of calculating &#8220;relatedness&#8221; of content, as well as the potential social and economic impact that this type of related content suggestion can have. They&#8217;ve been working in this space for a couple years and have a patented, scalable algorithm for computing &#8220;relatedness&#8221; of content from across thousands of different sites. When you sign up with BlogGlue, it displays &#8220;related links&#8221; on your blog post, just like YARPP does, but from your own site as well as from other content sources that you recommend. In turn, your blog posts may show up on your partners&#8217; sites as well.</p>

<p>What surprised me during that visit was some of the statistics they had gathered from their users: not only does BlogGlue bring in traffic to your site, <strong>visitors who come in via the BlogGlue network stay on your site 3–4 times longer than visitors from Google</strong> and view 2–4 times as many pages. This makes complete sense to me based on my experience with YARPP: <strong>people want to see content that is relevant to them</strong>. A search query is one way to find content you&#8217;re interested in, but it&#8217;s imperfect. With related posts across a network, the system can find related content based on all the content on the current page, which is a much richer &#8220;cue&#8221; than a simple search query would ever be.</p>

<p>Today I&#8217;m pleased to announce that YARPP has officially partnered with BlogGlue. Think of BlogGlue as &#8220;YARPP Pro&#8221;: it&#8217;s the multi-site, social, next generation of YARPP. YARPP helps your visitors discover more of your own content once they&#8217;re on your site—BlogGlue additionally helps more people discover your content in the first place, in a rich, meaningful way.</p>

<p>YARPP will of course continue to exist and be supported by me. BlogGlue and I will be advising each other on technical aspects of our offerings, pushing both products forward, as well as cross-promoting our offerings. <a href="http://http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">The latest version of YARPP</a>, 3.3, already has some UI simplifications which came out of a conversation with the BlogGlue team. I&#8217;m looking forward to working with them more in the future and I urge you to <a href="http://wordpress.org/extend/plugins/arkayne-site-to-site-related-content/">try out BlogGlue</a> on your own site as well.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yarpp-blogglue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Every website has a purpose</title>
		<link>http://mitcho.com/blog/projects/every-website-has-a-purpose/</link>
		<comments>http://mitcho.com/blog/projects/every-website-has-a-purpose/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 02:16:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[A/B testing]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ShrimpTest]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/?p=3714</guid>
		<description><![CDATA[Every website has a purpose. Maybe you want people to buy a product, donate to your cause, download your app, or subscribe to your mailing list. How can you confidently modify your site to make it more effective with respect to this goal? A/B testing is a process by which multiple variants of a website [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/after-the-deadline-for-firefox/' rel='bookmark' title='After the Deadline for Firefox'>After the Deadline for Firefox</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Every website has a purpose. Maybe you want people to buy a product, donate to your cause, download your app, or subscribe to your mailing list. How can you confidently modify your site to make it more effective with respect to this goal?</p>

<p><strong>A/B testing</strong> is a process by which multiple variants of a website are presented to different users randomly and statistical tools are used to see whether any variant is more <em>effective</em>, according to an overall goal metric such as conversions or revenue.</p>

<p>While various A/B testing products—many free—exist, none are made from the ground up to work within the WordPress ecosystem. I believe a solution made particularly for WordPress could make A/B testing so much easier and more straightforward, and that such a solution could be greatly beneficial to the platform as a whole.</p>

<p>I&#8217;m happy to announce my new project, code-named <strong>ShrimpTest</strong>,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> which is directly aimed at filling this void. I&#8217;ll be working on this project this summer together with the fantastic folks at <a href="http://automattic.com">Automattic</a>.</p>

<p>The best way to keep up with development is on the project&#8217;s development blog, <a href="http://shrimptest.wordpress.com/">the ShrimpTest P2</a>. Most updates will most likely be much shorter than this initial post. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  You can get less frequent, milestone-like updates by <a href="http://twitter.com/shrimptest">following ShrimpTest on twitter</a>. Development will be <a href="http://plugins.svn.wordpress.org/shrimptest/">open</a> so feel free to check it out (haha) and submit patches as well. As I go along, I&#8217;ll also look forward to your feedback.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Five dollars to the first person to correctly guess why I&#8217;m calling it ShrimpTest.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/after-the-deadline-for-firefox/' rel='bookmark' title='After the Deadline for Firefox'>After the Deadline for Firefox</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/every-website-has-a-purpose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring is for Speaking: JSConf, WordCamp SF, IACL</title>
		<link>http://mitcho.com/blog/projects/spring-is-for-speaking/</link>
		<comments>http://mitcho.com/blog/projects/spring-is-for-speaking/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 04:37:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[Chinese language]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[harvard]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[San Francisco]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[Washington D.C.]]></category>
		<category><![CDATA[WordCamp]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3448</guid>
		<description><![CDATA[I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring: JSConf.us: I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; Jetpack project at the premier Javascript conference in North America, JSConf.us, which this year will be April 17-18 in Washington D.C. and has a pirate theme.1 [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring:</p>

<p><span id="more-3448"></span></p>

<p><strong>JSConf.us</strong>:</p>

<p>I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; <a href="https://jetpack.mozillalabs.com/">Jetpack project</a> at the premier Javascript conference in North America, <a href="http://jsconf.us/2010/">JSConf.us</a>, which this year will be April 17-18 in Washington D.C. and has a pirate theme.<sup id="fnref:2"><a href="#fn:2" rel="footnote">1</a></sup> I&#8217;ll be giving a short talk in the main session and will also lead a hands-on Jetpack workshop in the hacker lounge. I&#8217;ve heard that JSConf is a lot of fun and I&#8217;m really looking forward to it! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><strong>WordCamp San Francisco</strong>:</p>

<p>I&#8217;m honored to have been invited to give a talk at <a href="http://2010.sf.wordcamp.org/">WordCamp San Francisco 2010</a>. WordCamps are community-organized events for the <a href="http://wordpress.org">WordPress</a> community, and the San Francisco WordCamp is the original and biggest. WordCamp SF will be at the Mission Bay Conference Center on May 1st. <a href="https://2010.sf.wordcamp.org/tickets/">Tickets available</a>.</p>

<p>My talk is tentatively titled &#8220;Abstract Your Code.&#8221;<sup id="fnref:1"><a href="#fn:1" rel="footnote">2</a></sup> WordPress is a great platform to build amazing content-rich applications on, and many of us have written new functionality in the form of plugins. I hope to encourage developers to make their code more portable and reusable after the project is done—or, ideally, to even start with abstraction in mind—to add to the &#8220;life&#8221; of the code and to consider then open-sourcing that functionality.</p>

<p>Hope to see you there!</p>

<p><strong>International Association of Chinese Linguistics (IACL) 18</strong>:</p>

<p>Finally, I&#8217;m thrilled to say that I got a paper accepted to the <a href="http://www.fas.harvard.edu/~iacl18/Site/index.html">annual meeting of the International Association of Chinese Linguistics</a> which this year is at Harvard on May 20-22. IACL is <em>the</em> big conference for Chinese linguistics, with about <a href="http://www.fas.harvard.edu/~IACL18/AcceptList.pdf">180 papers presenting</a>. I&#8217;ll be presenting <em>Two</em> Only<em>s in Mandarin Chinese</em>, my recent work on the formal syntax/semantics of two <em>only</em> words in Chinese: <em>zhǐ</em> (只) and <em>éryǐ</em> (而已). I&#8217;ve put up <a href="http://mitcho.com/academic/handout-20100226.pdf">a handout</a> of some of this material in work-in-progress form which I recently presented at <a href="http://people.fas.harvard.edu/~nicolae/SNEWS_2010/Welcome.html">SNEWS</a>.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:2">
<p>I&#8217;ll <a href="http://beijinghuar.com">fit right in</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:1">
<p>Sexier title suggestions welcome.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/spring-is-for-speaking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordCamp Boston 2010</title>
		<link>http://mitcho.com/blog/life/wordcamp-boston-2010/</link>
		<comments>http://mitcho.com/blog/life/wordcamp-boston-2010/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 02:02:01 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3298</guid>
		<description><![CDATA[This past weekend I gave a couple talks at the inaugural WordCamp Boston. WordCamps are local, community-organized events for WordPress users and enthusiasts. We had about 400 people at the Microsoft Cambridge campus. (I invite you to also check out more photos below as well as my full WordCamp gallery.) My first talk was &#8220;Getting [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://mitcho.com/blog/wp-content/uploads/2010/01/4096077627_c6d3035124_o.jpg" alt="4096077627_c6d3035124_o.jpg" border="0" width="470" height="246" /></p>

<p>This past weekend I gave a couple talks at the inaugural <a href="http://wordcampboston.com/">WordCamp Boston</a>. <a href="http://central.wordcamp.org/">WordCamps</a> are local, community-organized events for <a href="http://wordpress.org">WordPress</a> users and enthusiasts. We had about 400 people at the Microsoft Cambridge campus.</p>

<p><zp:boston/wordcamp/wordcamp28.jpg><zp:boston/wordcamp/wordcamp31.jpg><zp:boston/wordcamp/wordcamp35.jpg></p>

<p><span id="more-3298"></span></p>

<p>(I invite you to also check out more photos below as well as my <a href="http://mitcho.com/photos/boston/wordcamp/">full WordCamp gallery</a>.)</p>

<p>My first talk was &#8220;Getting Into The Loop,&#8221; which gives a quick taste of <a href="http://codex.wordpress.org/The_Loop">The Loop</a> which is a central programming construct in every WordPress application. (<a href="http://speakerrate.com/talks/2000-getting-into-the-loop">SlideShare</a>, <a href="http://speakerrate.com/talks/2000-getting-into-the-loop">SpeakerRate</a>)</p>

<p><embed src="http://blip.tv/play/AYHA938C" type="application/x-shockwave-flash" width="650" height="473" allowscriptaccess="always" allowfullscreen="true"></embed></p>

<p>My second talk was an <a href="http://en.wikipedia.org/wiki/Ignite_(event)">Ignite</a> talk on the importance of beta testing plugins. Ignite talks are five minute lightning talks with 20 slides which auto-advance every 15 seconds. (<a href="http://www.slideshare.net/mitcho/ignite-wordcamp-youd-beta-test-your-plugins">SlideShare</a>, <a href="http://speakerrate.com/talks/2031-ignite-wordcamp-you%E2%80%99d-beta%E2%80%99-test-your-plugins">SpeakerRate</a>)</p>

<p><object width="650" height="384"><param name="movie" value="http://www.youtube.com/v/n3RXpJrSAnw&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/n3RXpJrSAnw&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="650" height="384"></embed></object></p>

<p>The videos for both talks will ultimately go up on <a href="http://wordpress.tv">wordpress.tv</a>.</p>

<p>The event was a huge success and I&#8217;m looking forward to help organize WordCamp Boston 2011 as well! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><zp:boston/wordcamp/wordcamp11.jpg><zp:boston/wordcamp/wordcamp13.jpg><zp:boston/wordcamp/wordcamp16.jpg><zp:boston/wordcamp/wordcamp29.jpg><zp:boston/wordcamp/wordcamp60.jpg><zp:boston/wordcamp/wordcamp68.jpg><zp:boston/wordcamp/wordcamp77.jpg><zp:boston/wordcamp/wordcamp78.jpg><zp:boston/wordcamp/wordcamp82.jpg><zp:boston/wordcamp/wordcamp85.jpg><zp:boston/wordcamp/wordcamp86.jpg></p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/life/wordcamp-boston-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending WordPress talk at the Boston WordPress Meetup</title>
		<link>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/</link>
		<comments>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:40:19 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HookPress]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2959</guid>
		<description><![CDATA[Yesterday I gave a talk at the Boston WordPress Meetup. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I <a href="http://www.meetup.com/boston-wordpress-meetup/calendar/11378229/">gave a talk</a> at the <a href="http://www.meetup.com/boston-wordpress-meetup/">Boston WordPress Meetup</a>. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There was pretty good turnout, with about thirty or fourty people there.</p>

<p>My talk was a general introduction to WordPress plugin development, beginning with the concepts of <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">actions</a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filters</a>, and concluding with a description of <a href="http://mitcho.com/code/hookpress/">HookPress</a>, my new plugin which enables <a href="http://webhooks.org">webhooks</a> in WordPress. Here are the slides:</p>

<p><span id="more-2959"></span></p>

<div style="width:425px;text-align:left" id="__ss_2084487"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/extending-wordpress-with-webhooks" title="Extending WordPress with (Web)Hooks">Extending WordPress with (Web)Hooks</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/mitcho">Michael Yoshitaka Erlewine</a>.</div></div>

<p>The talk included some live coding which is always dangerous, but it all went off without a hitch.</p>

<p><a href="http://twitter.com/kurteng">Kurt Eng</a> was kind enough to get video of the talk as well which hopefully we&#8217;ll get up on <a href="http://wordpress.tv">wordpress.tv</a> in the near future. Bryan also sent me a link with some <a href="http://www.flickr.com/photos/76505157@N00/">photos on Flickr</a>.</p>

<p>Thank you to all who attended<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> and of course to Microsoft who provided the venue and food! The Boston WordPress Meetup is a great community and I hope to keep supporting it and its activities.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>For anyone who attended, I would greatly appreciate feedback on the talk <a href="http://speakerrate.com/talks/1470-extending-wordpress-with-web-hooks">at SpeakerRate</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HookPress: Webhooks for WordPress</title>
		<link>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/</link>
		<comments>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:23:25 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[webhooks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2672</guid>
		<description><![CDATA[I recently have spent a little time putting together a new WordPress plugin called HookPress. HookPress lets you add webhooks to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP. WordPress itself is built on a powerful plugin API which provides actions and filters. Actions correspond to events, so [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have spent a little time putting together a new WordPress plugin called HookPress. <a href="http://wordpress.org/extend/plugins/hookpress/">HookPress</a> lets you add <a href="http://webhooks.org">webhooks</a> to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP.</p>

<p>WordPress itself is built on a <a href="http://codex.wordpress.org/Plugin_API">powerful plugin API</a> which provides <a href="http://codex.wordpress.org/Plugin_API/Action_Reference"><strong>actions</strong></a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference"><strong>filters</strong></a>. Actions correspond to events, so you can set a webhook to fire when a post is published or a comment is made.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Filters let you modify some text when it is saved or displayed, so you can have your external webhook script reformat some text or insert some other content dynamically. Not all actions and filters are supported at this time, but I will continue to add more in.</p>

<p>There&#8217;s a <a href="http://upcoming.yahoo.com/event/4049111">webhooks meetup in San Francisco</a> today but I unfortunately left SF this morning, so I created a video which will be played there as a lightning talk. A demo of both types of webhooks are in the video as well.</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object></p>

<p><a href="http://vimeo.com/5905102">HookPress: add webhooks to WordPress</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>I&#8217;m really excited by this very simple but potentially high-impact plugin. I&#8217;d love to get your comments and feedback on this new plugin and hope to hear how you&#8217;re using HookPress!</p>

<p>ADDENDUM: Please also <a href="http://twitter.com/hookpress/">follow HookPress on twitter</a>!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>My friend Abi actually has already blogged about <a href="http://blog.abi.sh/2009/tweeting-your-blog-with-hookpress/">HookPress and how it can be used to tweet on post publication</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A Visual Guide to Community Command Localization</title>
		<link>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/</link>
		<comments>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 22:11:30 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2475</guid>
		<description><![CDATA[A natural language interface is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of Ubiquity localization. The first fruit of this research is in the localization of the parser and bundled commands in Ubiquity 0.5. Here today is a visual guide [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural language interface</a> is only &#8220;natural&#8221; if it&#8217;s in your natural language. With this mantra in mind, we&#8217;ve been making steady progress on the challenging problem of <a href="http://ubiquity.mozilla.com">Ubiquity</a> localization. The first fruit of this research is in the localization of the parser and bundled commands <a href="http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/">in Ubiquity 0.5</a>. Here today is a visual guide on command localization in Ubiquity and different options we can take in attacking the community command localization problem.<span id="more-2475"></span></p>

<h3>Command localization in Ubiquity 0.5</h3>

<p>A few important design decisions have already been made in implementing command localization in Ubiquity 0.5. The first was the choice of the <a href="http://en.wikipedia.org/wiki/gettext">gettext</a> po (portable object) file format. The po format is a de facto industry standard with many tools built for the format and this design choice hopefully lower the bar for prospective localizers.</p>

<p>Second, in order to simplify the matching of localizations and commands, we require that each command feed have one localization po file, rather than splitting the localizations of different commands across multiple po files.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/dist.png" alt="dist.png" border="0" width="650" height="250" /></p>

<p>Finding the appropriate localization po file for a JavaScript command feed is very simple with bundled commands as the files are managed in our main repository so we know exactly where to find them. We just take the command feed&#8217;s filename sans extension—the <em>feed key</em>—and look for <code>localizations/</code><em>lang</em><code>/</code><em>feed key</em><code>.po</code>, where <em>lang</em> is the active language code. This gives us a simple one to one relationship between the JavaScript command feed source and the appropriate localization.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/local.png" alt="local.png" border="0" width="650" height="218" /></p>

<h3>Background</h3>

<p>The ability of users to <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.5_Author_Tutorial">easily write their own Ubiquity commands</a> has always been a huge strength of the Ubiquity platform. Users can also &#8220;subscribe&#8221; to commands written by other users on other servers. In this case, local copies of those command sources are made.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/distcmds.png" alt="distcmds.png" border="0" width="650" height="420" /></p>

<p>The <a href="http://ubiquity.mozilla.com/herd/">herd</a> was developed as a dynamic aggregator of community Ubiquity commands. The herd keeps its own copy of each command source. The herd groups mirrors of command feeds on multiple servers together as well, giving each unique command feed a unique ID.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/herd.png" alt="herd.png" border="0" width="650" height="240" /></p>

<h3>Localizing distributed resources</h3>

<p>This distributed nature of the command feeds is exactly what complicates the localization of community commands. The original sources themselves are distributed, and we also want a community of localizers to be able to localize the commands—i.e., for the localizations to be (in some sense) distributed. Here I will present three options which I believe could be the basis for a winning solution, in order of more distributed to less distributed.</p>

<p>All three of these options have the property that localizations do not need to be &#8220;approved&#8221; or &#8220;managed&#8221; by the command author. For example, a possible standard where URL&#8217;s of localizations must be in the command feed is not considered. I believe this is a crucial property of any approach we decide on.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<h4>Option 1: a completely distributed option</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option1.png" alt="herd.png" border="0" width="650" height="300" /></p>

<p>In this option, localizers simply put the po files on their own servers (or some code snippet site such as github) and the user must then subscribe to those localizations much as they subscribe to commands now.</p>

<h4>Option 2: registration and discovery through the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option2.png" alt="herd.png" border="0" width="650" height="400" /></p>

<p>In this option, localizers put po files up on their own servers and then register that po file&#8217;s URL with the herd. The herd keeps track of each command feed&#8217;s localizations in different languages.</p>

<h4>Option 3: localizations on the herd</h4>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/option3.png" alt="herd.png" border="0" width="650" height="340" /></p>

<p>In this option, po localizations are uploaded right onto the herd. The herd is the centralized repository of all localizations for each command feed.</p>

<h3>Users first</h3>

<p>In coming up with a criteria for judging different models of community command localization, I think it is helpful to think of the end-user experience. Right now to subscribe to a new command a user must find the command (perhaps via the herd) and click on the subscribe button, then in most cases confirm that they are aware of the possible dangers and confirm subscription.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> What work is required for a user to subscribe to a new command <em>and get it in their language</em>?</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/subscribe.png" alt="herd.png" border="0" width="650" height="40" /></p>

<p>Under option one, the user would somehow have to find the localization scattered someplace on the internet of their own accord, and then install that localization by themself. In my mind, this is clearly a no go. With options two or three, however, when a user subscribes to a command feed Ubiquity can check with the herd to see whether there are any localizations available. The localizations could be offered to the user or the localization for the currently active language could be automatically installed. There are, on the other hand, disadvantages to requiring a centralized authority, exemplified by the fact that the current iteration of the herd itself has often been down.</p>

<h3>Summary and a call for comments</h3>

<p>As laid out in this visual guide, I personally have a couple main criteria which I believe we should follow:</p>

<ol>
<li><strong>localization independence</strong>: Command authors should not have to manage their commands&#8217; localizations. (See footnote 1.)</li>
<li><strong>friendly discovery and subscription</strong>: Users should not have to go out and find localizations by themselves. Localizations should be offered to the user.</li>
</ol>

<p>With these criteria, I&#8217;m pretty sure the only logical conclusion is that we need some level of centralization, pointing to options two and three. <strong>If you think of another option which satisfies these criteria, or disagree with the criteria above, I would love to know.</strong> In addition, <strong>have you encountered similar problems of localizing distributed resources elsewhere? What worked there?</strong></p>

<p>If this problem has been solved before, there is no need to reinvent the wheel. As far as I can tell, however, this could be a particularly hairy problem.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This strong view is based on my own experience as a <a href="http://mitcho.com/code/yarpp/">WordPress plugin author</a> and a subsequent conversation with <a href="http://en.wikipedia.org/wiki/Matt Mullenweg">Matt Mullenweg</a>. The WordPress plugin ecosystem requires that plugin authors orchestrate localizations and bundle them into releases. In the case of my plugin, this requires regular contact with over a dozen localizers.<br/>The case of WordPress plugins is actually much like that of Ubiquity commands&#8230; the plugins can be served on any server, distributed, but there is also a central repository, <a href="http://wordpress.org/extend/">wordpress.org/extend</a>.<br/>Matt and I agreed that if localizers could somehow localize plugins without going through the command author, most of whom produce their plugins by volunteering their time, the localization of plugins could be much more popular. Indeed, some localizers go ahead and publish po files for popular plugins, but those localizations are hard to find as there is no repository for the localizations either.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>As I&#8217;ve <a href="http://mitcho.com/blog/projects/friendlier-command-feed-subscription/">written before about Ubiquity&#8217;s command subscription</a>, there is much we can improve in this area of Ubiquity&#8217;s user experience.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-update/' rel='bookmark' title='Ubiquity Localization Update'>Ubiquity Localization Update</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/a-visual-guide-to-community-command-localization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Matt Mullenweg recommends YARPP on Tekzilla!</title>
		<link>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/</link>
		<comments>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 08:13:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[link]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Tekzilla]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2240</guid>
		<description><![CDATA[A new user of my WordPress plugin tipped me off to a recent Tekzilla segment where WordPress founder Matt Mullenweg recommended Yet Another Related Posts Plugin as one of his personal favorite WordPress plugins. Thanks Matt! ^^ Related posts: Yet Another Related Posts Plugin 2.0 Using Templates with YARPP 3 Keep up with Yet Another [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><embed class="rev3PlayerEmbed" type="application/x-shockwave-flash" src="http://revision3.com/player-v2887" allowFullScreen="true" allowScriptAccess="always" width="650" height="365" flashvars="startTime=1114&#038;endTime=1166" /></p>

<p>A new user of my <a href="http://wordpress.org">WordPress</a> plugin tipped me off to a recent <a href="http://revision3.com/tekzilla">Tekzilla</a> segment where WordPress founder <a href="http://en.wikipedia.org/wiki/Matt Mullenweg">Matt Mullenweg</a> recommended <a href="/code/yarpp">Yet Another Related Posts Plugin</a> as one of his personal favorite WordPress plugins. Thanks Matt! ^^</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/link/matt-mullenweg-recommends-yarpp-on-tekzilla/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fixing Geshi on line 2132</title>
		<link>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/</link>
		<comments>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 15:15:44 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2233</guid>
		<description><![CDATA[I recently noticed that some of my blog posts, most notably my Templates in YARPP 3 article, was producing a PHP error: Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&#60; at offset 3 in /&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2132 This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently noticed that some of my blog posts, most notably my <a href="http://mitcho.com/blog/projects/yarpp-3-templates/">Templates in YARPP 3</a> article, was producing a PHP error:</p>

<blockquote>
  <p><b>Warning:</b> preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?&lt; at offset 3 in <b>/&#8230;/html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php</b> on <b>line 2132</b></p>
</blockquote>

<p>This seemed to be coming from the version 1.0.8.4 version of Geshi I had installed. A quick <a href="http://www.google.com/search?q=geshi+line+2132">google search for &#8220;geshi line 2132&#8221;</a> gives you over a thousand errors, so this seems to be common issue. <a href="http://qbnz.com/highlighter/">Geshi</a> is a fabulous and popular syntax highlighter and is the core component of the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax plugin</a> for WordPress.</p>

<p>I did some digging around and realized that the issue was with the compilation of this monstrosity of a regular expression, used (as far as I can tell) to identify PHP code snippets, for example the &lt;?php &#8230;&#160;?&gt; keywords:</p>


<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">/(?&lt;start&gt;&lt;\\?(?&gt;php\b)?)(?:
(?&gt;[^\&quot;'?\\/&lt;]+)|
\\?(?!&gt;)|
(?&gt;'(?&gt;[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|
(?&gt;\&quot;(?&gt;[^\&quot;\\\\]|\\\\\&quot;|\\\\\\\\|\\\\)*\&quot;)|
(?&gt;\\/\\*(?&gt;[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|
\\/\\/(?&gt;.*?$)|
\\/(?=[^*\\/])|
&lt;(?!&lt;&lt;)|
&lt;&lt;&lt;(?&lt;phpdoc&gt;\w+)\s.*?\s\k&lt;phpdoc&gt;
)*(?&lt;end&gt;\\?&gt;|\Z)/sm</pre></div></div>


<p>Not knowing exactly where to start in diagnosing this crazy expression, I simply disabled those &#8220;script delimiters&#8221; in the <code>geshi/php.php</code> file. The sections I commented out are lines 1080-1101. Now the script delimiters like <code>&amp;lt;?php</code> don&#8217;t get highlighted nicely, but I feel that&#8217;s a small price to pay for eliminating these errors. <a href="http://wordpress.org/support/topic/274864">Another solution for the WP-Syntax users</a> seems to be to downgrade to 0.9.4. Hopefully in the near future an update to Geshi will come out which fixes this issue once and for all.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/fixing-geshi-on-line-2132/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Count command for Ubiquity</title>
		<link>http://mitcho.com/blog/projects/count-command-for-ubiquity/</link>
		<comments>http://mitcho.com/blog/projects/count-command-for-ubiquity/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 04:18:26 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1788</guid>
		<description><![CDATA[(This is primarily a blog post to test out Sandro&#8217;s plugin for embedding Ubiquity commands in WordPress. If you don&#8217;t see the &#8220;subscribe to command&#8221; come up, make sure you&#8217;re looking at the single page view.) A while back I created a count command for Ubiquity to count HTML elements on a page, so I&#8217;ll [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
<li><a href='http://mitcho.com/blog/projects/selecting-from-ubiquity/' rel='bookmark' title='selecting from Ubiquity'>selecting from Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/rolling-out-the-roles/' rel='bookmark' title='Rolling out the Roles'>Rolling out the Roles</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>(This is primarily a blog post to test out <a href="http://github.com/gialloporpora/wordpress-ubiquity-plugin/tree/master">Sandro&#8217;s plugin for embedding Ubiquity commands in WordPress</a>. If you don&#8217;t see the &#8220;subscribe to command&#8221; come up, make sure you&#8217;re looking at the <a href="http://mitcho.com/blog/projects/count-command-for-ubiquity/">single page view</a>.)</p>

<p>A while back I created a <code>count</code> command for Ubiquity to count HTML elements on a page, so I&#8217;ll share it here. The idea is super simple: select some text on your page and execute <code>count p</code> to get the number of paragraphs, or <code>count a</code> to get the number of links, or <code>count tr</code> to get the number of table rows. This is super useful when reading articles with charts or lists online and you want to know how many there are without doing something like copy-pasting into Excel.</p>

<p>The <code>count</code> command is built using jQuery so it can even understand targets like <code>p.class</code> or <code>a[href=...]</code>. Give it a try! ^^</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
<li><a href='http://mitcho.com/blog/projects/selecting-from-ubiquity/' rel='bookmark' title='selecting from Ubiquity'>selecting from Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/rolling-out-the-roles/' rel='bookmark' title='Rolling out the Roles'>Rolling out the Roles</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/count-command-for-ubiquity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Templates with YARPP 3</title>
		<link>http://mitcho.com/blog/projects/yarpp-3-templates/</link>
		<comments>http://mitcho.com/blog/projects/yarpp-3-templates/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 13:26:38 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>
		<category><![CDATA[Yet Another Photoblog]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1270</guid>
		<description><![CDATA[Post updated January 2012 to reflect cleaner template code available with YARPP 3.4. If you have a YARPP support question not directly related to the templating feature, please use the YARPP support forums. Version 3 of Yet Another Related Posts Plugin is a major rewrite which adds two new powerful features: caching and templating. Today [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><em>Post updated January 2012 to reflect cleaner template code available with YARPP 3.4.</em></p>

<p><strong>If you have a YARPP support question not directly related to the templating feature, please use <a href="http://wordpress.org/tags/yet-another-related-posts-plugin">the YARPP support forums</a>.</strong></p>

<p>Version 3 of <a href="http://mitcho.com/code/yarpp">Yet Another Related Posts Plugin</a> is a major rewrite which adds two new powerful features: caching and templating. Today I&#8217;m going to show you how you can use <em>templates</em> to customize the look of your related posts output.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>Previously with YARPP you were relatively limited in the ways you could present related posts. You were able to set some HTML tags to wrap your posts in and choose how much of an excerpt (if any) to display. This limited interface worked great for many users&#8212;indeed, these options still exists in YARPP 3.0. However, there&#8217;s also a new option for those of you who want to put your PHP skills to work and have complete control over your related posts display. The option will let you choose any files in the <code>templates</code> subdirectory of YARPP.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/01/e38394e382afe38381e383a3-1.png" alt="templates interface" title="templates interface" width="410" height="163" class="alignnone size-full wp-image-1273" /></p>

<p><span id="more-1270"></span></p>

<h3>The structure of a YARPP template</h3>

<p>Let&#8217;s take a look inside the example template, included with YARPP 3 (<code>yarpp-template-example.php</code>):</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;h3&gt;Related Posts&lt;/h3&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<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: #000000; font-weight: bold;">?&gt;</span>
&lt;ol&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<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;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<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;/a&gt;&lt;/li&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ol&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;No related posts.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


<p>There are two basic parts to this (and most all) YARPP template: (a) what you display when there are related posts and (b) what you display when there aren&#8217;t. We make this switch with the conditional on line 6. If there are related posts, we introduce an ordered list and use the <code>while</code> loop to loop over all the related posts. For each post, we use the snippet <code>the_post();</code> to load the appropriate post data, then print the line item.</p>

<p>You&#8217;ll notice that we&#8217;re using familiar template tags here such as <code>the_permalink()</code> and <code>the_title()</code>. If you&#8217;ve ever had to tweak or build a WordPress theme before, you&#8217;ll immediately feel at home. I&#8217;ll touch on this again later.</p>

<h3>The power of PHP</h3>

<p>One big advantage of this new templating system is that you can control exactly how the posts are listed, breaking out of all of the previous structural limitations. For example, in the <code>template-list.php</code> template, we put the information for each related post in an array and then concatenate the strings with <code>implode</code>. This way, we produce a comma-separated list for our readers without any stray commas before or after the list, which was impossible until now.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$postsArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$postsArray</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; rel=&quot;bookmark&quot;&gt;'</span><span style="color: #339933;">.</span>get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span><span style="color: #000088;">$postsArray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// print out a list of the related items, separated by commas</span></pre></td></tr></table></div>


<p>You can also run any arbitrary PHP in the template file—even roll another WP_Query, as in the case of <code>template-random.php</code>, where a random post is returned when there are no related posts.</p>

<h3>Familiar template tags</h3>

<p>As mentioned before, the tags we use in these YARPP templates are the same as the template tags used in any WordPress template. In fact, any WordPress <a href="http://codex.wordpress.org/Template_Tags">template tag</a> will work in the YARPP <a href="http://codex.wordpress.org/The_Loop">Loop</a>. You can use these template tags to display the excerpt, the post date, the comment count, or even some custom metadata. I&#8217;ve also written two special template tags which only work within a YARPP Loop: <code>the_score()</code> and <code>get_the_score()</code>. As you may expect, this will print or return the match score of that particular related post.</p>

<p>In addition, template tags from other plugins will also work. For an example, take a look at the <code>yarpp-template-photoblog.php</code> file:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>8
9
10
11
12
</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: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<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>
		<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;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'yapb_is_photoblog_post'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>yapb_is_photoblog_post<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: #000000; font-weight: bold;">?&gt;</span>
		&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> yapb_get_thumbnail<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;/a&gt;&lt;/li&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


<p>In this template&#8217;s YARPP Loop, we use some template tags introduced by the <a href="http://wordpress.org/extend/plugins/yet-another-photoblog/">Yet Another Photoblog</a> plugin. If you have the Yet Another Photoblog plugin installed, you can use this template to display thumbnails of related posts in lieu of the titles. Notice that here we&#8217;re checking first whether each related post is indeed a photo post or not using <code>yapb_is_photoblog_post()</code> and then using the Yet Another Photoblog <code>yapb_get_thumbnail()</code> template tag to get the location of the thumbnail.</p>

<p>Templating in YARPP 3.0 enables the blog admin to uber-customize their related posts display using the lingua franca of PHP and <a href="http://codex.wordpress.org/Template_Tags">template tags</a>. Feel free to comment here with ideas, comments, and of course links to your YARPP-powered blogs. I look forward to seeing what the WordPress community does with this new feature!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>For those of you interested in the WP and SQL voodoo used to make this happen, I&#8217;ve posted <a href="http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/">a more technical article</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yarpp-3-templates/feed/</wfw:commentRss>
		<slash:comments>113</slash:comments>
		</item>
		<item>
		<title>This is what a release looks like</title>
		<link>http://mitcho.com/blog/projects/release-downloads/</link>
		<comments>http://mitcho.com/blog/projects/release-downloads/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 12:55:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[Mint]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1157</guid>
		<description><![CDATA[This is what the latest release (2.1.6) of my Yet Another Related Posts Plugin looked like under Mint, using my WordPress plugin downloads pepper, which in turn gets its data from wordpress.org: It&#8217;s always interesting to see these release spikes in download traffic. Note that this release was on the Wednesday but that was during [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is what the latest release (2.1.6) of my <a href="/code/yarpp">Yet Another Related Posts Plugin</a> looked like under <a href="http://www.haveamint.com/">Mint</a>, using my WordPress plugin downloads pepper, which in turn gets its data from <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/stats/">wordpress.org</a>:</p>

<p><img src="/blog/wp-content/uploads/2008/12/mint-wordpress-downloads.png" alt="" title="YARPP downloads 2.1.6" /></p>

<p>It&#8217;s always interesting to see these release spikes in download traffic. Note that this release was on the Wednesday but that was during the day, so Wednesday&#8217;s traffic is still higher than the normal ~300/day level, while the big peak (by day) is on Thursday. Too bad wordpress.org doesn&#8217;t give me hourly stats, though I guess that would be a little ridiculous.</p>

<p>YARPP is just about at that 35k download mark. I&#8217;m looking forward to the next release. ^^</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/' rel='bookmark' title='Keep up with Yet Another Related Posts Plugin with RSS!'>Keep up with Yet Another Related Posts Plugin with RSS!</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/release-downloads/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>External orders in WordPress queries</title>
		<link>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/</link>
		<comments>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 15:34:40 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[ranking]]></category>
		<category><![CDATA[suggestions]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[WP_Query]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1102</guid>
		<description><![CDATA[The advanced WordPress user is intimately familiar with query_posts, the function which controls which posts are displayed in &#8220;The Loop.&#8221; query_posts gives plugin and theme writers the ability to display only posts written in Janary (query_posts("monthnum=1")) or disallow posts from a certain category (query_posts("cat=-529")1). One of the parameters you can set here is orderby which [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The advanced WordPress user is intimately familiar with <a href="http://codex.wordpress.org/Template_Tags/query_posts"><code>query_posts</code></a>, the function which controls which posts are displayed in &#8220;The Loop.&#8221; <code>query_posts</code> gives plugin and theme writers the ability to display only posts written in Janary (<code>query_posts("monthnum=1")</code>) or disallow posts from a certain category (<code>query_posts("cat=-529")</code><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>). One of the parameters you can set here is <code>orderby</code> which affects the ordering of the posts returned, with allowed values such as <code>author</code>, <code>date</code>, or <code>title</code>. But what if you want to order your posts in some other order, defined outside of your <code>wp_posts</code> table? Here I&#8217;m going to lay out some thoughts on rolling your own external ordering source for WordPress queries.</p>

<p>In order to introduce an external ordering source, we need to do four things:
1. create the external ordering source,
2. hook up (read &#8220;<code>join</code>&#8221;) the external ordering source
3. make sure we use that order, and
4. make it play nice. ^^</p>

<p>By the way, I&#8217;m going to assume you, dear reader, are PHP-savvy, proficient in MySQL, and already know a little about WordPress. This how-to is not for the PHPhobic.</p>

<p><span id="more-1102"></span></p>

<h3>The ordering source</h3>

<p>For this example, suppose we want to display posts by order of &#8220;interestingness.&#8221; We&#8217;ll just create a table called <code>wp_interestingness</code> with two columns, <code>ID</code> and <code>interestingness</code> and populate it with some data. We&#8217;ll even be nice to our database by making sure the <code>ID</code> is the primary key. Easy.</p>

<h3>Hook up the external ordering source</h3>

<p>When you run a query through <code>query_posts()</code> (or use <code>WP_Query</code>&#8217;s <code>query</code> method<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>), what it&#8217;s doing is taking your special request and translating it into a MySQL statement. This means a query like <code>"monthnum=1"</code> is turned into <code>SELECT ... wp_posts.* FROM wp_posts WHERE 1=1 AND MONTH(wp_posts.post_date)='1' ...</code>. Every different query introduces something new to the basic <code>SELECT</code> command—in this case, the <code>AND MONTH(wp_posts.post_date)='1'</code>.</p>

<p>We first want to introduce the <code>interestingness</code> for each post and that means <code>join</code>ing the new table into the query. We&#8217;ll do this using the <code>posts_join</code> <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filter</a>. This filter lets you add a <code>join</code> statement to the MySQL request.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_join'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_join_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_join_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$arg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; natural join wp_interestingness &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>Note that here we&#8217;re using <code>natural join</code> as <code>wp_posts</code> and <code>wp_interestingness</code> have only one key in common, <code>ID</code>, and that&#8217;s exactly the column we want to join them on.</p>

<h3>Use the new order</h3>

<p>Now that we&#8217;ve <code>join</code>ed <code>wp_interestingness</code> in, we can refer to <code>wp_interestingness.interestingness</code> in our query. Note now that, by default, an <code>$wpdb-&gt;posts.post_date</code> will be used to order the posts. We&#8217;ll use another filter here; this time <code>posts_orderby</code>, to patch this part of the query. We&#8217;ll search for the default <code>ORDER BY</code> value and replace it with our own <code>interestingness</code>.</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="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_orderby'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_orderby_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_orderby_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</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;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$arg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>.post_date&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp_interestingness.interestingness&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>By the way, you can now check the resulting MySQL query by <code>echo</code>ing <code>$wp_query-&gt;request</code>. (If you&#8217;re using the <code>WP_Query</code> method I advocated below in footnote (2), you&#8217;ll of course have to change <code>$wp_query</code> to the <code>WP_Query</code> object you&#8217;re using.)</p>

<h3>Learn to play nice ^^</h3>

<p>The instructions above do indeed work, but they also cause some major breakdowns in other functions of your blog. Why? That&#8217;s because the current code will edit your queries for every instance of The Loop: your index page, your archives, and your RSS feeds. You probably only want to search by interestingness in certain situations. What we need is a way to tell our (admittedly stupid) <code>my_join_filter</code> and <code>my_orderby_filter</code> when they should apply their <code>interestingness</code> magic and when they shouldn&#8217;t. There are several ways to set up such a system but here I&#8217;ll lay out one that I feel is particularly elegant. We&#8217;ll set it up so you can actually use <code>query_posts("orderby=interestingness")</code> and it&#8217;ll know what you&#8217;re talking about.</p>

<p>One of the first things that happens in <code>query_posts</code>—indeed, way before even the <code>posts_join</code> and <code>posts_orderby</code> filters—is an action hook called <code>parse_query</code>. This lets us look at the initial state of the <code>WP_Query</code> object as it starts to run. In particular, we can look at the <code>orderby</code> query variable and see if we want to order by <code>interestingness</code>. If we do, we&#8217;ll set a global variable called <code>$use_interestingness_flag</code> to be <code>true</code>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parse_query'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'set_use_interestingness_flag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> set_use_interestingness_flag<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</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;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query_vars</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'interestingness'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$yarpp_score_override</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">else</span>
		<span style="color: #000088;">$yarpp_score_override</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>Now we just have to edit our filters so they only run when <code>$use_interestingness_flag == true</code>. We also will make sure to turn the flag back off in <code>my_orderby_filter</code>, as it&#8217;s our last filter to run during each query. It&#8217;s just like putting the seat back down after using a unisex bathroom.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup></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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_join'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_join_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_join_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</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;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$use_interestingness_flag</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$arg</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; natural join wp_interestingness &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_orderby'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_orderby_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_orderby_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</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;">$wpdb</span><span style="color: #339933;">,</span> <span style="color: #000088;">$use_interestingness_flag</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$use_interestingness_flag</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$arg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>.post_date&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp_interestingness.interestingness&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$use_interestingness_flag</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<p>This method has a great advantage as you can just set it up once and invoke it whenever you want, even together with other parameters, without any additional code. For example, you can try <code>query_posts("monthnum=1&amp;orderby=interestingness")</code> or <code>query_posts("cat=-529&amp;orderby=interestingness")</code>.</p>

<h3>Conclusion</h3>

<p>Adding an external ordering source to your WordPress post queries can be relatively straightforward if you understand what <code>query_posts</code> does and take advantage of its <a href="http://codex.wordpress.org/Plugin_API">hooks</a>. This tutorial can also serve as the basis for many other patches to <code>WP_Query</code>, not just the <code>orderby</code> parameter. To better understand the way WordPress builds its MySQL queries and the many <code>posts_*</code> filters which you can take advantage of, go to the source: <code>wp-includes/query.php</code>. Finally, you can use the special <code>parse_query</code> hook and global variables as flags to only apply the filters when necessary.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This, incidentally, is precisely what I do to hide, by default, <a href="http://twitter.com/mitchoyoshitaka/">my tweets</a> in my <code>index.php</code> and <code>archives.php</code>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>If you&#8217;re going to get serious about rolling your WordPress queries I highly recommend you follow <a href="http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/">Mark Ghosh&#8217;s advice</a> on initializing another object of the <code>WP_Query</code> class and using the <code>query</code> method, rather than just using the global <code>query_posts</code> function.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>The perceptive reader will note that we are still searching for the string <code>"$wpdb-&gt;posts.post_date"</code> in <code>my_orderby_filter</code>, instead of something like <code>"$wpdb-&gt;posts.interestingness"</code>. That&#8217;s because the <code>orderby</code> value of <code>interestingness</code> is not one of the allowed <code>orderby</code> values (search for <code>$allowed_keys</code> in <code>wp-includes/query.php</code> to see the list). Thus the MySQL <code>ORDER BY</code> value is set to the default of <code>"$wpdb-&gt;posts.post_date"</code> before it gets to the <code>posts_orderby</code> filter. Now you know.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/external-orders-in-wordpress-queries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Keep up with Yet Another Related Posts Plugin with RSS!</title>
		<link>http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/</link>
		<comments>http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 16:43:34 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=789</guid>
		<description><![CDATA[As more and more people have been using my Yet Another Related Posts Plugin for WordPress, I thought it would be nice to have an RSS feed for users to stay on top of the latest releases. Yet Another Related Posts Plugin version log RSS 2.0 Clicking on a version&#8217;s permalink will let you download [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/stats/">more and more people</a> have been using my <a href="/code/yarpp">Yet Another Related Posts Plugin</a> for <a href="http://en.wikipedia.org/wiki/WordPress">WordPress</a>, I thought it would be nice to have an RSS feed for users to stay on top of the latest releases.</p>

<div class="files">
<div class="file rss">
<a href="http://mitcho.com/code/yarpp/yarpp.rss">Yet Another Related Posts Plugin version log</a><br />
<span class="specs">RSS 2.0</span>
</div>
</div>

<p>Clicking on a version&#8217;s permalink will let you download the plugin. Subscribe now and be the first to find out when the upcoming version 2.1 is released!</p>

<p>I decided to semi-automate this RSS-producing process as well. As a plugin developer using <a href="http://wordpress.org/extend">wordpress.org</a>&#8217;s plugin hosting, I sync a local copy of the plugin to their server using <a href="http://en.wikipedia.org/wiki/SVN">SVN</a>. I wrote a <a href="http://en.wikipedia.org/wiki/PHP">PHP</a> script to get the modification date information directly from the local files, parse the version log in the read me, and produce the RSS feed. If there&#8217;s an interest, perhaps I&#8217;ll release this code in the future.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/keep-up-with-yet-another-related-posts-plugin-with-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Related Posts Plugin 2.0</title>
		<link>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/</link>
		<comments>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 15:06:06 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=521</guid>
		<description><![CDATA[Yet Another Related Posts Plugin 2.0.5 16&#160;kb - zip Well, it&#8217;s been a while since I updated my plugin YARPP&#8212;in my humble opinion the best related posts plugin for WordPress. ^^ Today I release version 2.0, incorporating a number of important requests and bug fixes: New algorithm which considers tags and categories, by frequent request [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.5.zip">Yet Another Related Posts Plugin 2.0.5</a><br />
<span class="specs">16&#160;kb - zip</span>
</div>
</div>

<p>Well, it&#8217;s been a while since I updated my plugin <a href="http://mitcho.com/code/yarpp/">YARPP</a>&#8212;in my humble opinion the best related posts plugin for <a href="http://www.wordpress.org">WordPress</a>. ^^ Today I release <a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.zip">version 2.0</a>, incorporating a number of important requests and bug fixes:</p>

<ul>
<li>New algorithm which considers tags and categories, by frequent request</li>
<li>Order by score, date, or title, <a href="http://wordpress.org/support/topic/158459">by request</a></li>
<li>Excluding certain tags or categories, <a href="http://wordpress.org/support/topic/161263">by request</a></li>
<li>Sample output displayed in the options screen</li>
<li>Bugfix: <a href="http://wordpress.org/support/topic/155034?replies=5">an excerpt length bug</a></li>
<li>Bugfix: now compatible with the following plugins:

<ul>
<li>diggZEt</li>
<li>WP-Syntax</li>
<li>Viper&#8217;s Video Quicktags</li>
<li>WP-CodeBox</li>
<li>WP shortcodes</li>
</ul></li>
</ul>

<p>Check out the <a href="http://mitcho.com/code/yarpp/">Yet Another Related Posts Plugin page on this site</a>, <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">the page on wordpress.org</a>, or <a href="http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.2.0.zip">download it directly now</a>!</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Markdown for WordPress and bbPress</title>
		<link>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/</link>
		<comments>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:07:28 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=274</guid>
		<description><![CDATA[Markdown for WordPress and bbPress 1.0 30&#160;kb - zip I like many others am a big fan of John Gruber&#8217;s Markdown, a simple typesetting spec for entering text in a clean, legible plain-text fashion and outputting to (X)HTML. Michel Fortin did the fabulous job of porting the Markdown engine to PHP, making it a plugin [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/markdown-for-wordpress-and-bbpress.1.0.zip">Markdown for WordPress and bbPress 1.0</a><br />
<span class="specs">30&#160;kb - zip</span>
</div>
</div>

<p>I like many others am a big fan of John Gruber&#8217;s <a href="http://daringfireball.net/projects/markdown/">Markdown</a>, a simple typesetting spec for entering text in a clean, legible plain-text fashion and outputting to (X)HTML. <a href="http://michelf.com/projects/php-markdown/">Michel Fortin</a> did the fabulous job of porting the Markdown engine to PHP, making it a plugin for <a href="http://wordpress.org/">WordPress</a>, <a href="http://www.bblog.com/">bBlog</a>, and <a href="http://textpattern.com/">TextPattern</a>.</p>

<p>I&#8217;ve been using Markdown for all my blog posts here. Recently, though, I was in charge of a <a href="http://www.bbpress.org">bbPress</a> bulletin board (the &#8220;less is more&#8221; sister project to WordPress) for the Shoreland <a href="http://mitcho.com/blog/2008/05/08/scav-hunt/">Scav Hunt team</a>, and wanted to use Markdown formatting there. And <a href="http://bbpress.org/forums/topic/markdown">I wasn&#8217;t the only one wanting to do this</a>.</p>

<p>With some experimenting and research into the filters in the bbPress text flow (different than <a href="http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/">the WordPress one</a>), I was able to make Markdown work in bbPress. This involved adding a special bbPress plugin wrapper to Michel Fortin&#8217;s <a href="http://bbpress.org/forums/topic/markdown/extra/">PHP Markdown Extra</a>. I&#8217;ve rereleased this plugin as <strong>Markdown for WordPress and bbPress</strong>, available at both <a href="http://wordpress.org/extend/plugins/markdown-for-wordpress-and-bbpress/">wordpress.org</a> and <a href="http://bbpress.org/plugins/topic/markdown-for-wordpress-and-bbpress/">bbpress.org</a>. Enjoy!</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifiying WordPress plugin activation behavior</title>
		<link>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/</link>
		<comments>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 10:39:22 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2008/01/05/modifiying-wordpress-plugin-activation-behavior/</guid>
		<description><![CDATA[As I continue to work on and debug Yet Another Related Posts Plugin and WP-Smartdate, I&#8217;ve come across an issue where plugin activation fails, but I get no useful error message. When I try to activate the plugin, I am redirected to a url of the type /plugins.php?error=true&#38;plugin=...&#38;_error_nonce=.... This redirect just gives me the plugins [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>As I continue to work on and debug <a href="http://mitcho.com/blog/2007/12/29/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin</a> and <a href="http://mitcho.com/blog/2007/11/27/introducing-smartdate/">WP-Smartdate</a>, I&#8217;ve come across an issue where plugin activation fails, but I get no useful error message.</p>

<p>When I try to activate the plugin, I am redirected to a url of the type <code>/plugins.php?error=true&amp;plugin=...&amp;_error_nonce=...</code>. This redirect just gives me the plugins control panel with my plugin still disactivated, and with no useful error message.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> This apparently is an issue with the Plugin Protection mechanism introduced in WP 2.2. <a href="http://wordpress.org/support/topic/118418">A quick fix (hack) is available on the WP forums.</a></p>

<p>Here&#8217;s hoping this helps some people scratching their heads, and that this behavior is reconsidered/fixed in future releases.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Apparently some people get a message like &#8220;Plugin could not be activated because it triggered a fatal error.&#8221;&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin/' rel='bookmark' title='Yet Another Related Posts Plugin'>Yet Another Related Posts Plugin</a></li>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Related Posts Plugin</title>
		<link>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/</link>
		<comments>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 13:49:20 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[threshold]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2007/12/29/yet-another-related-posts-plugin/</guid>
		<description><![CDATA[UPDATE: This posting is now outdated&#8230; for the latest information on YARPP, please visit YARPP&#8217;s very own page on my site, or its page on wordpress.org. If you have questions, please submit on the wordpress.org forum. Thanks! Description Today I&#8217;m releasing Yet Another Related Posts Plugin (YARPP1) 1.0 for WordPress. It&#8217;s the result of some [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>UPDATE:</h3>

<p>This posting is now outdated&#8230; for the latest information on YARPP, please visit <a href="/code/yarpp/">YARPP&#8217;s very own page</a> on my site, or <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin">its page on <code>wordpress.org</code></a>. If you have questions, please submit on <a href="http://wordpress.org/tags/yet-another-related-posts-plugin">the <code>wordpress.org</code> forum</a>. Thanks!</p>

<h3>Description</h3>

<p>Today I&#8217;m releasing Yet Another Related Posts Plugin (YARPP<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>) 1.0 for <a href="http://www.wordpress.org">WordPress</a>. It&#8217;s the result of some tinkering with <a href="http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin">Peter Bowyer&#8217;s version</a> of <a href="http://wasabi.pbwiki.com/Related%20Entries">Alexander Malov &amp; Mike Lu&#8217;s Related Entries plugin</a>. Modifications made include:</p>

<ol>
<li><em>Limiting by a threshold</em>: Peter Bowyer did the great work of making the algorithm use <a href="http://en.wikipedia.org/wiki/mysql">mysql</a>&#8217;s <a href="http://dev.mysql.com/doc/en/Fulltext_Search.html">fulltext search</a> score to identify related posts. But it currently just displayed, for example, the top 5 most &#8220;relevant&#8221; entries, even if some of them weren&#8217;t at all similar. Now you can set a threshold limit<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> for relevance, and you get more related posts if there are more related posts and less if there are less. Ha!</li>
<li><em>Being a better plugin citizen</em>: now it doesn&#8217;t require the user to click some sketchy button to <code>alter</code> the database and enable a <code>fulltext key</code>. Using <a href="http://codex.wordpress.org/Function_Reference/register_activation_hook"><code>register_activation_hook</code></a>, it does it automagically on plugin activation. Just install and go!</li>
<li><em>Miscellany</em>: a nicer options screen, displaying the fulltext match score on output for admins, an option to allow related posts from the future, a couple bug fixes, etc.</li>
</ol>

<h3>Installation</h3>

<p>Just put it in your <code>/wp-content/plugins/</code> directory, activate, and then drop the <code>related_posts</code> function in your <a href="http://codex.wordpress.org/The_Loop">WP loop</a>. Change any options in the Related Posts (YARPP) Options pane in Admin > Plugins.</p>

<p>You can override any options in an individual instance of <code>related_posts</code> using the following syntax:</p>

<blockquote>
  <p>`related_posts(limit, threshold, before title, after title, show excerpt, len, before excerpt, after excerpt, show pass posts, past only, show score);</p>
</blockquote>

<p>Most of these should be self-explanatory. They&#8217;re also in the same order as the options on the YARPP Options pane.</p>

<p>Example: <code>related_posts(10, null, 'title: ')</code> changes the maximum related posts number to 10, keeps the default threshold from the Options pane, and adds <code>title:</code> to the beginning of every title.</p>

<p>There&#8217;s also a <code>related_posts_exist)</code> function. It has three optional arguments to override the defaults: a threshold, the past only boolean, and the show password-protected posts boolean.</p>

<h3>Examples</h3>

<p>For a barebones setup, just drop <code>&lt;?php related_posts(); ?&gt;</code> right after <code>&lt;?php the_content() ?&gt;</code>.</p>

<p>On my own blog I use the following code with <code>&lt;li&gt;</code> and <code>&lt;/li&gt;</code> as the before/after entry options:</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>related_posts_exist<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: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;Related posts:
&lt;ol&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> related_posts<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;/ol&gt;
&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;No related posts.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<h3>Coming soon (probably)</h3>

<ol>
<li>Incorporation of tags and categories in the algorithm. I&#8217;ve gotten the code working, but I still need to think about what the most natural algorithm would be for weighing these factors against the mysql fulltext score currently used (and works pretty well, I must say).</li>
<li>Um, something else! Let me know if you have any suggestions for improvement. ^^</li>
</ol>

<h3>Version log</h3>

<p>1.0   Initial upload (20071229)</p>

<p>1.0.1 Bugfix: 1.0 assumed you had Markdown installed (20070105)</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Pronounced &#8220;yarp!&#8221;, kind of like this, but maybe with a little more joy:<br /><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/7cOuGJMRORw&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/7cOuGJMRORw&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Did you know that threshold has only two h&#8217;s!? I&#8217;m incensed and just went through and replaced all the instances of <code>threshhold</code> in my code. It&#8217;s really not a thresh-hold!?&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/introducing-smartdate/' rel='bookmark' title='Introducing Smartdate'>Introducing Smartdate</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/yet-another-related-posts-plugin/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Introducing Smartdate</title>
		<link>http://mitcho.com/blog/projects/introducing-smartdate/</link>
		<comments>http://mitcho.com/blog/projects/introducing-smartdate/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 12:47:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[metablog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[smartdate]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/2007/11/27/introducing-smartdate/</guid>
		<description><![CDATA[I recently have been working on a WordPress plugin called WP-Smartdate and I&#8217;m happy to say that it is hosted at wordpress.org starting today. As some people have noticed, my blog recently has included little links on word like &#8220;yesterday,&#8221; with a machine readable version of the date reference (called a &#8220;microformat&#8221; in the biz). [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/metablog/yes-i-have-a-blog/' rel='bookmark' title='Yes, I have a blog'>Yes, I have a blog</a></li>
<li><a href='http://mitcho.com/blog/life/how-i-name-my-kids/' rel='bookmark' title='How I name my kids'>How I name my kids</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have been working on a <a href="http://www.wordpress.org">WordPress</a> plugin called WP-Smartdate and I&#8217;m happy to say that it is <a href="http://wordpress.org/extend/plugins/wp-smartdate/">hosted at wordpress.org</a> starting today. As some people have noticed, my blog recently has included little links on word like &#8220;yesterday,&#8221; with a machine readable version of the date reference (called a &#8220;<a href="http://microformats.org/">microformat</a>&#8221; in the biz). Download the plugin and get started!</p>

<div class="files">
<div class="file zip">
<a href="http://downloads.wordpress.org/plugin/wp-smartdate.0.1.zip">WP-Smartdate 0.1</a><br />
<span class="specs">4&#160;kb - zip</span>
</div>
</div>

<p>This blog post describes release 0.1&#8230; For the latest description, check out the <a href="http://wordpress.org/extend/plugins/wp-smartdate/">WP-Smartdate plugin page</a> or <a href="http://mitcho.com/code">mitcho.com/code</a>.</p>

<p>Please comment! I would love to hear your feedback on the plugin.</p>

<h2>Description</h2>

<p>WP-Smartdate looks for <em>relative date expressions</em> in your blog posts, such as &#8220;tomorrow,&#8221; &#8220;this coming Monday,&#8221; &#8220;last Friday,&#8221; and adds the date reference (like &#8220;2007-11-26&#8221;) as a machine-readable <a href="http://microformats.org/wiki/datetime-design-pattern">microformat</a>.</p>

<h3>Why Smartdate?</h3>

<p>WP-Smartdate was created for three simple audiences:</p>

<ol>
<li><em>For the machine:</em> While many professional information retrieval algorithms go far beyond the scope of this program, smartdate helps the process along by adding machine-readable tags to relative date expressions.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> In addition, these machine tags, in turn, help the human: a search on Google for &#8220;November 7th, 2007,&#8221; for example, will not pull up a document talking about &#8220;yesterday,&#8221; written on the 8th, but it will pull up the smartdate output of <code>2007-11-07</code>.</li>
<li><em>For the human reader:</em> Blog posts are often written in the &#8220;now,&#8221; using relative time expressions without concern for how the text will be read in the future. WP-Smartdate makes such posts easier to read and comprehend temporally<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>.</li>
<li><em>For <a href="http://mitcho.com">me</a></em>: Because I think this sort of thing is fun!</li>
</ol>

<h3>A typology of smartdate date expressions</h3>

<p>The following types of expressions are resolved with respect to the speech time&#8212;in WP-Smartdate&#8217;s case, the blog post date.</p>

<ol>
<li><em>simple references</em>: &#8220;yesterday,&#8221; &#8220;today,&#8221; &#8220;tomorrow,&#8221;</li>
<li><em>next/last <abbr title="day of the week">DOTW</abbr> expressions</em>: &#8220;next Friday,&#8221; &#8220;this past Sunday,&#8221; &#8220;this Monday&#8221;</li>
</ol>

<h3>For the future</h3>

<ul>
<li><em>static dates</em>: &#8220;January 1st, 2007&#8221;</li>
<li><em>duration shift expressions</em>: &#8220;5 days ago,&#8221; &#8220;fourscore and seven years ago&#8221;</li>
<li><em>day of the week shifts</em>: &#8220;2 Fridays ago&#8221;</li>
<li>clean up the code!</li>
</ul>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>One could argue that relative dates are a perfect place to use the <code>abbr</code> tag, as they are a sort of natural-language shortcut for more static temporal expressions. In fact, WP-Smartdate&#8217;s output also follows the <a href="http://microformats.org/wiki/datetime-design-pattern">datetime microformat design pattern draft</a> with two caveats:
1. Unfortunately, the datetime <a href="http://microformats.org/wiki/semantic-class-names">semantic class</a> has not yet been set as the standard is a draft. WP-Smartdate uses <code>datetime</code>. See the <a href="http://microformats.org/wiki/rest/datatypes#Proposal">Date and Time datatype proposal</a> for more information.
2. The <a href="http://microformats.org/wiki/rest/datatypes#Proposal">current recommendation for datetime</a> pushes for following the <a href="http://www.w3.org/TR/NOTE-datetime">W3C datetime profile</a>, which does not support the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO-8601 time interval</a> specification, which <del>is</del> will be used by WP-Smartdate.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Even though <a href="http://www.smackthemouse.com/20040108">the <code>abbr</code> tag should only be used for machine reading</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/metablog/yes-i-have-a-blog/' rel='bookmark' title='Yes, I have a blog'>Yes, I have a blog</a></li>
<li><a href='http://mitcho.com/blog/life/how-i-name-my-kids/' rel='bookmark' title='How I name my kids'>How I name my kids</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/introducing-smartdate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

