<?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>tadhg.com &#187; WordPress</title>
	<atom:link href="http://tadhg.com/wp/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tadhg.com/wp</link>
	<description>Wherein some things Tadhg are discussed</description>
	<lastBuildDate>Mon, 06 Sep 2010 02:05:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sabbatical.close()</title>
		<link>http://tadhg.com/wp/2010/05/16/sabbatical-close/</link>
		<comments>http://tadhg.com/wp/2010/05/16/sabbatical-close/#comments</comments>
		<pubDate>Mon, 17 May 2010 06:36:56 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[CrossFit]]></category>
		<category><![CDATA[diet]]></category>
		<category><![CDATA[document formats]]></category>
		<category><![CDATA[exercise]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reStructuredText]]></category>
		<category><![CDATA[roleplaying]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[sports]]></category>
		<category><![CDATA[T]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[tennis]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2942</guid>
		<description><![CDATA[After a highly enjoyable, productive, and extended period, it’s time for me to return to the world of paid work.
I’m quite happy with the things I’ve done during my time off. Many of them are important only to me, but then, it’s been my time off.

Here are some of the things I’ve done since leaving [...]]]></description>
			<content:encoded><![CDATA[<p>After a highly enjoyable, productive, and extended period, it’s time for me to return to the world of paid work.</p>
<p>I’m quite happy with the things I’ve done during my time off. Many of them are important only to me, but then, it’s been my time off.<br />
<span id="more-2942"></span><br />
Here are some of the things I’ve done since leaving Metaweb that I consider significant:</p>
<ul>
<li><strong>CrossFit</strong>. I’m approaching the one year mark, and it’s hard to overstate the importance of that for me. This is the first time in my life I’ve managed to keep an exercise routine of any kind going for that long. Not coincidentally, I’m also in the best shape of my life. I now feel that some kind of regular, intense, exercise has a similar place in my life to my morning pages—that is, something I I regard as mandatory and more or less permanent.
</li>
<li><strong>Diet</strong>. Not just <a href="http://tadhg.com/wp/2009/07/20/considering-carnivorism/" title="Considering Carnivorism" >switching back to eating meat</a>, but also radically cutting down on sugar and processed foods. This also has a lot to do with my being in good shape.
</li>
<li><strong>Document format</strong>. Until this year, I hadn’t found a text-based document format I liked, but I have now finally settled on <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>. One of the effects of this is that I shifted to doing all of my writing in a text editor rather than doing some of it in word processors. Another effect is that all of my writing is now much more amenable to programmatic manipulation.
</li>
<li><strong>Programming my own environment</strong>. Following from the previous item, I spent quite a bit of time working on solutions to various small niggles in my workflows, so that far less of my time is consumed by setup for writing. Some examples of this include scripts to insert the template for blog posts into my editor, scripts to publish to my blog directly from my editor, scripts to do word counting precisely as I wish it to be done, and many other small utilities that remove minor annoyances that I previously encountered almost every day. In many respects this kind of thing is precisely what programming and computers are for: to make it easier to create, and to lessen the gap between a thought and expression of that thought.
</li>
<li><strong>Digital organization</strong>. This includes <a href="http://tadhg.com/wp/2009/05/04/version-control-recovery/" title="Version Control Recovery" >recovering my subversion repository</a>, restoring my blog to proper working order, and various other steps that have made my digital domain much more manageable. This is bound up with the previous item too.
</li>
<li><strong>Switching to Vim</strong>. This was probably a long time coming, but nevertheless required a fair amount of work, not least in porting all my scripts for jEdit over to it. I’ve been extremely happy with Vim. I think that to most people this might sound trivial; how many people would regard switching word processors as an “achievement”? But a text editor is different from a word processor, and switching to Vim isn’t like switching between non-modal text editors. This, combined with moving all my writing to text editors and thus to Vim, is a profound change for me, and one that I’m very happy I took the time to get through.
</li>
<li><strong>WordPress plugins</strong>. <a href="http://tadhg.com/wp/wordpress-plugins/" title="WordPress Plugins" >I wrote some of these</a> to improve my blog after I got it working again.
</li>
<li><strong>PyWordCount</strong>. My word counting script/Vim plugin is done, but I have to finish the documentation for it and make it public. It’s significant to me because it’ll be my first self-contained public Python project, and also because it’s an outgrowth of the document format switch, the Vim switch, and the focus on programming my own environment to a much greater degree.
</li>
<li><strong>Q’Rith</strong>. I ran my first roleplaying sessions in 15 years, and am currently running my first roleplaying campaign in 15 years, in a world that I’ve created and am quite happy with so far.
</li>
<li><strong>Tennis</strong>. I started playing it again, and don’t know why I ever stopped.
</li>
</ul>
<p>Those are the main highlights. Many of them are internal, or are things that only I notice, but I think the effect they’ve had on me is actually quite major, and in positive ways.</p>
<p>As for what’s next, I’ll write about that tomorrow.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/crossfit/" rel="tag">CrossFit</a>, <a href="http://tadhg.com/wp/tag/diet/" rel="tag">diet</a>, <a href="http://tadhg.com/wp/tag/document-formats/" rel="tag">document formats</a>, <a href="http://tadhg.com/wp/tag/exercise/" rel="tag">exercise</a>, <a href="http://tadhg.com/wp/tag/food/" rel="tag">food</a>, <a href="http://tadhg.com/wp/tag/games/" rel="tag">games</a>, <a href="http://tadhg.com/wp/tag/goals/" rel="tag">goals</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/restructuredtext/" rel="tag">reStructuredText</a>, <a href="http://tadhg.com/wp/tag/roleplaying/" rel="tag">roleplaying</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/sports/" rel="tag">sports</a>, <a href="http://tadhg.com/wp/tag/t/" rel="tag">T</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/tennis/" rel="tag">tennis</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/version-control/" rel="tag">version-control</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/03/30/2010-goals-first-quarter-review/">2010 Goals: First Quarter Review</a> <span class="related-post-date timestamp">Tue 30 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/01/2010-goals/">2010 Goals</a> <span class="related-post-date timestamp">Fri 01 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/31/crossfit-and-coding-and-meat/">CrossFit and Coding (and Meat)</a> <span class="related-post-date timestamp">Thu 31 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/16/sabbatical-close/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9 Upgrade</title>
		<link>http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/</link>
		<comments>http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 23:56:30 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2579</guid>
		<description><![CDATA[I upgraded this blog to WordPress 2.9 today, and it appeared to go entirely smoothly. Please let me know if you notice any breakage.
Tags: Blog, coding, PHP, tech, web-development, WordPressRelated PostsWordPress 2.8 Upgrade Sun 14 Jun 2009WP Plugins: Recent Commentary and Show Tags in RSS Mon 23 Mar 2009Some RSS Changes Thu 19 Mar 2009New [...]]]></description>
			<content:encoded><![CDATA[<p>I upgraded this blog to <a class="reference external" href="http://codex.wordpress.org/Version_2.9">WordPress 2.9</a> today, and it appeared to go entirely smoothly. Please let me know if you notice any breakage.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/10/html-past-and-future/">HTML Past and Future</a> <span class="related-post-date timestamp">Tue 10 Nov 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>404 Pages</title>
		<link>http://tadhg.com/wp/2009/09/10/404-pages/</link>
		<comments>http://tadhg.com/wp/2009/09/10/404-pages/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 07:36:15 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2188</guid>
		<description><![CDATA[wpbeginner has a list of their favorite WordPress 404 pages. There are some good ones in there, but none of them do what I think they should do—that is, as well as provide helpful links to popular pages, also provide a list of guesses about where the user was actually trying to go. Coincidentally, today [...]]]></description>
			<content:encoded><![CDATA[<p><a class="reference external" href="http://www.wpbeginner.com/">wpbeginner</a> has a <a href="http://www.wpbeginner.com/showcase/best-of-best-wordpress-404-error-page-designs/" title="Best of Best WordPress 404 Error Page Designs" >list of their favorite WordPress 404 pages</a>. There are some good ones in there, but none of them do what I think they should do—that is, as well as provide helpful links to popular pages, also provide a list of guesses about where the user was actually trying to go. Coincidentally, today I also read <a href="http://wordaligned.org/articles/longest-common-subsequence" title="Longest common subsequence" >this excellent article about finding the longest common subsequence between two strings</a>. So, at some point, I’ll improve my blog’s 404 page so that it calls, probably via asynchronous request, a Python script that checks the user’s requested URL against all valid URLs WordPress knows about, and then suggests to the user whatever the closest matches are. I’m somewhat surprised that this isn’t done more often, but it seems that far too many sites are really blasé about 404s.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/23/pywebsf-site-update/">PyWebSF Site Update</a> <span class="related-post-date timestamp">Tue 23 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/08/gps-urls-math-python-featuritis/">GPS, URLs, Math, Python, Featuritis</a> <span class="related-post-date timestamp">Tue 08 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/17/addons-mozilla-org-moving-from-cakephp-to-django/">addons.mozilla.org Moving from CakePHP to Django</a> <span class="related-post-date timestamp">Tue 17 Nov 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/16/some-character-encoding-gotchas/">Some Character Encoding Gotchas</a> <span class="related-post-date timestamp">Thu 16 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/09/10/404-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better reST–WordPress Pipeline</title>
		<link>http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/</link>
		<comments>http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 07:15:47 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reStructuredText]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1983</guid>
		<description><![CDATA[Last week I posted about my setup for going from reStructuredText to WordPress. It involved a shell script, some Python scripts, and the pbpaste and pbcopy commands. It worked, but it was a little on the convoluted side.
Now I have a slightly better process, and one that I will have used to publish this post.

The [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted about <a class="reference external" href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">my setup for going from reStructuredText to WordPress</a>. It involved a shell script, some Python scripts, and the <tt class="docutils literal"><span class="pre">pbpaste</span></tt> and <tt class="docutils literal"><span class="pre">pbcopy</span></tt> commands. It worked, but it was a little on the convoluted side.</p>
<p>Now I have a slightly better process, and one that I will have used to publish this post.<br />
<span id="more-1983"></span><br />
The previous version was launched via <a class="reference external" href="http://en.wikipedia.org/wiki/Quicksilver_(software)">Quicksilver</a> and operated on the contents of the clipboard; the new version is run from the command line—or, even better, from within jEdit—and operates on a file. It:</p>
<ul>
<li>Runs the contents of the file through my reST–Wordpress script, which uses <a class="reference external" href="http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/"><tt class="docutils literal"><span class="pre">rst2wp</span></tt></a> and some customized other Python scripts.</li>
<li>Submits the transformed text to WordPress via <a class="reference external" href="http://code.google.com/p/python-blogger/"><tt class="docutils literal"><span class="pre">python-blogger</span></tt></a>, a script for doing blog XMLRPC operations in Python.</li>
<li>Runs <tt class="docutils literal"><span class="pre">svn</span> <span class="pre">add</span></tt> on the file.</li>
<li>Opens the WordPress Edit Draft page for the submitted post.</li>
</ul>
<p>So, the previous steps for me were:</p>
<ul>
<li>Write post in reStructuredText in <a class="reference external" href="http://www.jedit.org/">jEdit</a>.</li>
<li>Select all.</li>
<li>Copy.</li>
<li>Invoke a shell script via <a class="reference external" href="http://en.wikipedia.org/wiki/Quicksilver_(software)">Quicksilver</a>.</li>
<li>Switch to WordPress new post tab in Firefox.</li>
<li>Paste.</li>
<li>Fiddle with the post settings slightly.</li>
<li>Post.</li>
</ul>
<p>While the new ones are:</p>
<ul>
<li>Write post in reStructuredText in jEdit.</li>
<li>Save.</li>
<li>Invoke a jEdit macro to run the Python script from within the editor.</li>
<li>Switch to WordPress new post tab in Firefox.</li>
<li>Fiddle with the post settings slightly.</li>
<li>Post.</li>
</ul>
<p>(As a bonus, this version also adds the file to Subversion.)</p>
<p>The jEdit macro seems</p>
<p>These are the components necessary to make it work:</p>
<ul>
<li><a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a>—of course, to handle the reStructuredText</li>
<li><a class="reference external" href="http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/"><tt class="docutils literal"><span class="pre">rst2wp</span></tt></a>, which I&#8217;ve modified a little for my own purposes.</li>
<li><a class="reference external" href="http://code.google.com/p/python-blogger/"><tt class="docutils literal"><span class="pre">python-blogger</span></tt></a>, to talk to WordPress in Python.</li>
<li><a class="reference external" href="http://blog.articlemarketingautomation.com/enabling-xml-rpc-on-wordpress">WordPress with XMLRPC enabled</a> so that software can talk to it.</li>
<li>A short script of my own that pulls the pieces together. (This uses <a class="reference external" href="http://docs.python.org/library/subprocess.html"><tt class="docutils literal"><span class="pre">os.subprocess</span></tt></a>, so Python 2.4 or better is required)</li>
<li>A jEdit macro to run the script from the last step within the editor.</li>
</ul>
<p>I&#8217;m pretty happy with it, and I think it should be fairly cross-platform, which is important to me as I&#8217;d like to take this whole setup with me if I switch environments in future.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/restructuredtext/" rel="tag">reStructuredText</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/01/27/some-minor-software-projects/">Some Minor Software Projects</a> <span class="related-post-date timestamp">Sun 27 Jan 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Workflow with reStructuredText</title>
		<link>http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/</link>
		<comments>http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 06:57:00 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reStructuredText]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1914</guid>
		<description><![CDATA[I wrote about moving my writing over to reStructuredText on Sunday, and since then I&#8217;ve moved both my morning pages and my blog writing to it. The latter proved more complicated, primarily because I wanted to make the process almost as easy as writing pseudo-HTML (which is more or less WordPress&#8217; native format, and kind [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote about <a href="http://tadhg.com/wp/2009/07/12/moving-from-word-processors-to-restructuredtext/" title="Moving From Word Processors to reStructuredText" >moving my writing over to reStructuredText on Sunday</a>, and since then I&#8217;ve moved both my morning pages and my blog writing to it. The latter proved more complicated, primarily because I wanted to make the process almost as easy as writing pseudo-HTML (which is more or less WordPress&#8217; native format, and kind of mine, too, for the last several years). With some hacky wrangling, I&#8217;ve managed to set that up.<br />
<span id="more-1914"></span><br />
I don&#8217;t write my posts in the browser. That&#8217;s too prone to crashing, and I like my text editor, <a class="reference external" href="http://jedit.org/">jEdit</a>, too much for that. On top of that, I want to be able to use <a class="reference external" href="http://subversion.tigris.org/">Subversion</a> for my posts, as I do for more or less everything I wrote. So for the last couple of years, I would write the posts in jEdit and then copy and paste the finished product into the WordPress new post window.</p>
<p>Since I generally tinker with a few things once I see the post preview, it&#8217;s never been worth it to me to try to do automatic posting from the command line, which I know is theoretically possible with WordPress. I thought I might move in that direction given the reStructuredText move, but it didn&#8217;t work out that way.</p>
<p>One option was to use the <a class="reference external" href="https://launchpad.net/rest-wordpress/">rest-wordpress</a> plugin, which would do the reStructuredText parsing on the blog side, so that my workflow would be to paste the reStructuredText source into the WordPress edit field as usual, and then have it turn it into HTML. While that seemed a reasonable option, I was eager to create some custom directives that would let me make reStructuredText even more useful. Sadly, custom directives aren&#8217;t that easy to add in, and I decided that if I planned to develop those, I should do it locally rather than on the server side.</p>
<p>The old workflow was:</p>
<ul>
<li>Write post in pseudo-HTML in jEdit.</li>
<li>Select all.</li>
<li>Copy.</li>
<li>Switch to WordPress new post tab in Firefox.</li>
<li>Paste.</li>
<li>Fiddle with the post settings slightly.</li>
<li>Post.</li>
</ul>
<p>The new workflow:</p>
<ul>
<li>Write post in reStructuredText in jEdit.</li>
<li>Select all.</li>
<li>Copy.</li>
<li>Invoke a shell script via <a class="reference external" href="http://en.wikipedia.org/wiki/Quicksilver_(software)">Quicksilver</a>.</li>
<li>Switch to WordPress new post tab in Firefox.</li>
<li>Paste.</li>
<li>Fiddle with the post settings slightly.</li>
<li>Post.</li>
</ul>
<p>Just one extra step, and that step consists of hitting <tt class="docutils literal"><span class="pre">Command-Space</span></tt>, typing <tt class="docutils literal"><span class="pre">blog</span></tt>, and hitting return. Given how easy that is, I&#8217;m quite happy with it. Particularly since some of my custom directives make certain kinds of content easier, and because reStructuredText is better to compose in than psuedo-HTML.</p>
<p>In fact, when I <a href="http://tadhg.com/wp/2007/10/11/restructuredtext/" title="reStructuredText" >first wrote about reStructuredText</a>, I complained about the hyperlink format, but having written a blog post or two with it, I find that I actually prefer it. It makes it easier to highlight the links and then go get the actual URLs later, if that&#8217;s what I want to do, and if not the short link syntax is actually fine.</p>
<p>Getting to that workflow turned out to be fairly tricky. I&#8217;m sure that I could have approached it in ways that would have made things easier. The critical components are:</p>
<ul>
<li>A local install of <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a></li>
<li><a href="http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/" title="Using ReStructured Text with WordPress" >rst2wp, a WordPress writer for reStructuredText by Matthias Friedrich</a>.</li>
<li>Some pre- and post-processing Python scripts.</li>
<li>The OS X Terminal <tt class="docutils literal"><span class="pre">pbcopy</span></tt> and <tt class="docutils literal"><span class="pre">pbpaste</span></tt> commands, which I wasn&#8217;t really aware of before.</li>
<li>A shell script to tie it all together.</li>
</ul>
<p>This is what happens, thanks to a combination of those components, when I invoke the shell script with Quicksilver, after I&#8217;ve copied the text in jEdit:</p>
<ul>
<li>The shell script pastes the contents of the clipboard to the pre-processor, which strips out some things, like metadata that I have in the file but don&#8217;t want in the post, and puts the newly-cleaned content into the clipboard</li>
<li>The shell script pastes the clipboard to rst2wp, which then puts its output to the clipboard.</li>
<li>The shell script pastes the clipboard to the post-processor, which does some minor rearranging to suit my particular workflow.</li>
</ul>
<p>All of which saves what would be quite a lot of time if I had to do the cleanup by hand.</p>
<p>One of the major obstacles I encountered was, of course, character encoding. I&#8217;ll probably write that up later this week, because the solutions are poorly doumented, and it&#8217;s not a fun thing to bang your head against.</p>
<p>At some point I might try to clean the scripts up and to make the effort to post to WordPress directly. I think the best way for that to work would be to submit the post as a draft, get the id of the draft, and then open a browser window with that draft open for editing. That would save at least a moment or two&#8230; the tricky part, it appears, is getting the tags to submit properly.</p>
<p>I do have some issues with reStructuredText, but need to put a little more thought into how I think they should be fixed before posting about them. I&#8217;m primarily unhappy with how custom directives are handled.</p>
<p>All in all, very much a developer&#8217;s endeavor: lots of effort to make something seem almost exactly the same for benefits that most people wouldn&#8217;t notice or might think of as disadvantages.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/restructuredtext/" rel="tag">reStructuredText</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/01/27/some-minor-software-projects/">Some Minor Software Projects</a> <span class="related-post-date timestamp">Sun 27 Jan 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PyWebSF Site Update</title>
		<link>http://tadhg.com/wp/2009/06/23/pywebsf-site-update/</link>
		<comments>http://tadhg.com/wp/2009/06/23/pywebsf-site-update/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 23:46:01 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1831</guid>
		<description><![CDATA[I did some work on the PyWebSF site, so that it looks rather better than it did with the default WordPress theme. I altered a pretty good WordPress theme called Arras Theme, which I was fairly impressed with. As a reminder, the first meeting is tonight.
Tags: design, python, web-development, WordPressRelated Posts404 Pages Thu 10 Sep [...]]]></description>
			<content:encoded><![CDATA[<p>I did some work on the <a href="http://www.pywebsf.org/">PyWebSF</a> site, so that it looks rather better than it did with the default WordPress theme. I altered a pretty good WordPress theme called <a href="http://www.arrastheme.com/">Arras Theme</a>, which I was fairly impressed with. As a reminder, the <a href="http://www.pywebsf.org/2009/06/17/py-web-sf-1-june-23rd-6pm-sf-main-public-librarys-stong-room/">first meeting</a> is tonight.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/design/" rel="tag">design</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/09/10/404-pages/">404 Pages</a> <span class="related-post-date timestamp">Thu 10 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/08/gps-urls-math-python-featuritis/">GPS, URLs, Math, Python, Featuritis</a> <span class="related-post-date timestamp">Tue 08 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/17/addons-mozilla-org-moving-from-cakephp-to-django/">addons.mozilla.org Moving from CakePHP to Django</a> <span class="related-post-date timestamp">Tue 17 Nov 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/11/social-design-patterns/">Social Design Patterns</a> <span class="related-post-date timestamp">Tue 11 Aug 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/16/some-character-encoding-gotchas/">Some Character Encoding Gotchas</a> <span class="related-post-date timestamp">Thu 16 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/26/python-syntax-highlighting-for-star-light/">Python Syntax Highlighting for star-light</a> <span class="related-post-date timestamp">Fri 26 Jun 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/06/23/pywebsf-site-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 Upgrade</title>
		<link>http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/</link>
		<comments>http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 01:44:08 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1796</guid>
		<description><![CDATA[Today I upgraded this blog to WordPress 2.8, a relatively smooth process. I ran into completely unrelated problems (hitting the process limit for my shell account) that derailed things for a while, but the WordPress upgrade itself was smooth.
I use Subversion to upgrade, first using
svn export --force http://core.svn.wordpress.org/tags/2.8/ . 
in my development environment, seeing if [...]]]></description>
			<content:encoded><![CDATA[<p>Today I upgraded this blog to <a href="http://codex.wordpress.org/Version_2.8">WordPress 2.8</a>, a relatively smooth process. I ran into completely unrelated problems (hitting the process limit for my shell account) that derailed things for a while, but the WordPress upgrade itself was smooth.</p>
<p>I use <a href="http://subversion.tigris.org/">Subversion</a> to upgrade, first using<br />
<code>svn export --force http://core.svn.wordpress.org/tags/2.8/ . </code><br />
in my <a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">development environment</a>, seeing if things look okay there, then checking in the 2.8 changes to my own repository (the only niggly part because I neglected to clean the dev environment of changes before the export, so I had to look through things to see what was part of the upgrade), backing up my live database, and then checking the changes out to the live environment. It all looks fine, and hopefully will continue to function normally.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/10/html-past-and-future/">HTML Past and Future</a> <span class="related-post-date timestamp">Tue 10 Nov 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fiction Organization</title>
		<link>http://tadhg.com/wp/2009/05/24/fiction-organization/</link>
		<comments>http://tadhg.com/wp/2009/05/24/fiction-organization/#comments</comments>
		<pubDate>Sun, 24 May 2009 23:04:21 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[fiction]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1723</guid>
		<description><![CDATA[I made a WordPress page containing a list of all the fiction I&#8217;ve published on this blog. I had to do this by hand, because it appears difficult to get a reasonable list using various WordPress approaches (such as tags). The page I created is hardly a masterpiece of user interface design (I hope to [...]]]></description>
			<content:encoded><![CDATA[<p>I made a WordPress page containing a <a href="http://tadhg.com/wp/fiction/" title="Fiction Index">list of all the fiction I&#8217;ve published on this blog</a>. I had to do this by hand, because it appears difficult to get a reasonable list using various WordPress approaches (such as tags). The page I created is hardly a masterpiece of user interface design (I hope to improve it significantly over time), but it&#8217;s better than what was there previously.<br />
<span id="more-1723"></span><br />
I will end up making it more complicated from a code point of view, because I want to be able to display by each link the publication date and some of the tags of the piece&#8212;and I don&#8217;t want to have to edit those by hand. This mix of manual selection and arbitrary tagging isn&#8217;t handled very well by the current WordPress functionality, which isn&#8217;t that surprising. I did think it would be slightly easier to achieve than it looks like it will be, however.</p>
<p>The series plugin I hope to write at some point would address some of the issues, by making it easy to get a list of links to each piece in a series, but even that wouldn&#8217;t address the lists that aren&#8217;t series.</p>
<p>One of the problems is with tagging. Partly it&#8217;s a nomenclature/overloading issue: I use the &#8220;fiction&#8221; and &#8220;writing&#8221; tags to mean not just my fiction and writing, but also the works of others and commentary on fiction and writing. For some reason the notion of a &#8220;my fiction&#8221; tag is unappealing to me.</p>
<p>The notion of a &#8220;my favorites&#8221; tag even less appealing. I don&#8217;t mind putting together a list of the pieces that I&#8217;m most happy with, but somehow tagging each one of them as a favorite seems extremely cheesy. That might be nomenclature again, and I could perhaps get around it somehow by having a less cloying name for the tag. I need to think about that one further and see if I can figure out just what the problem is.</p>
<p>Until I do, though, having all of my fiction work handily linked from one page is a significant advance (the power of HTML!). <a href="http://tadhg.com/wp/fiction/" title="Fiction Index">Use it to find stories of mine</a> to read or re-read&#8212;and, hopefully, enjoy.</a></p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/fiction/" rel="tag">fiction</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/08/30/perfectionism-is-hard/">Perfectionism is Hard</a> <span class="related-post-date timestamp">Mon 30 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/02/three-routines/">Three Routines</a> <span class="related-post-date timestamp">Mon 02 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/18/wandering-mind/">“Wandering Mind”</a> <span class="related-post-date timestamp">Sun 18 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/29/2009-goals-review/">2009 Goals Review</a> <span class="related-post-date timestamp">Tue 29 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/31/title-capitalization/">Title Capitalization</a> <span class="related-post-date timestamp">Fri 31 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/30/2009-goals-status/">2009 Goals Status</a> <span class="related-post-date timestamp">Thu 30 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/05/26/1000th-post/">1000th Post</a> <span class="related-post-date timestamp">Tue 26 May 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/05/24/fiction-organization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bad Behavior Plugin</title>
		<link>http://tadhg.com/wp/2009/04/07/bad-behavior-plugin/</link>
		<comments>http://tadhg.com/wp/2009/04/07/bad-behavior-plugin/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 18:55:14 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1567</guid>
		<description><![CDATA[The various blog moves and reworkings seemed to reduce the amount of comment spam I was getting, but now it&#8217;s gotten out of hand once more, so I&#8217;m resuming the use of the Bad Behavior WordPress plugin. Hopefully this isn&#8217;t something any legitimate readers or commenters will notice, but if for some reason you find [...]]]></description>
			<content:encoded><![CDATA[<p>The various blog moves and reworkings seemed to reduce the amount of comment spam I was getting, but now it&#8217;s gotten out of hand once more, so I&#8217;m resuming the use of the <a href="http://wordpress.org/extend/plugins/bad-behavior/">Bad Behavior</a> WordPress plugin. Hopefully this isn&#8217;t something any legitimate readers or commenters will notice, but if for some reason you find it affecting you, please let me know via email.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/05/24/fiction-organization/">Fiction Organization</a> <span class="related-post-date timestamp">Sun 24 May 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/12/twitter-experimentation/">Twitter Experimentation</a> <span class="related-post-date timestamp">Thu 12 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/">New Blog Functionality: Related Posts</a> <span class="related-post-date timestamp">Sun 01 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/30/perfectionism-is-hard/">Perfectionism is Hard</a> <span class="related-post-date timestamp">Mon 30 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/02/three-routines/">Three Routines</a> <span class="related-post-date timestamp">Mon 02 Aug 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/04/07/bad-behavior-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Plugins: Recent Commentary and Show Tags in RSS</title>
		<link>http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/</link>
		<comments>http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:38:25 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1516</guid>
		<description><![CDATA[I finally got around to writing up docs for, and then packaging, the two WordPress plugins I&#8217;ve finished recently:

Recent Commentary Widget, which contains the code used for the current comments sidebar on the main page and which I described here.
Show Tags in RSS, which adds a list of the tags for a post to the [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to writing up docs for, and then packaging, the two WordPress plugins I&#8217;ve finished recently:</p>
<ul>
<li><a href="http://tadhg.com/wp/wordpress-plugins/recent-commentary-widget/">Recent Commentary Widget</a>, which contains the code used for the current comments sidebar on the main page and which I <a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/" title="New Blog Functionality: Recent Commentary">described here</a>.</li>
<li><a href="http://tadhg.com/wp/wordpress-plugins/show-tags-in-rss/">Show Tags in RSS</a>, which adds a list of the tags for a post to the end of the post&#8217;s entry in the RSS feed.</li>
</ul>
<p>I&#8217;m currently looking at support for series in WordPress, and am considering either writing my own plugin or using/forking <a href="http://unfoldingneurons.com/neurotic-plugins/organize-series-wordpress-plugin">the Organize Series plugin</a>.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/sql/" rel="tag">SQL</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/12/twitter-experimentation/">Twitter Experimentation</a> <span class="related-post-date timestamp">Thu 12 Feb 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some RSS Changes</title>
		<link>http://tadhg.com/wp/2009/03/19/some-rss-changes/</link>
		<comments>http://tadhg.com/wp/2009/03/19/some-rss-changes/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 03:44:20 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1491</guid>
		<description><![CDATA[I&#8217;ve made some changes to my Related Posts by Tags plugin, so that it&#8217;s now possible to add the list of related posts to the RSS feed entries. As I was experimenting with this, I realized that I wanted the RSS entries to show the tags for a post as well, so I wrote a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made some changes to my <a href="http://tadhg.com/wp/wordpress-plugins/related-posts-by-tag-widget/">Related Posts by Tags</a> plugin, so that it&#8217;s now possible to add the list of related posts to the RSS feed entries. As I was experimenting with this, I realized that I wanted the RSS entries to show the tags for a post as well, so I wrote a (very simple) plugin to do that, too.</p>
<p>As a result, those of you reading this via RSS will now see a list of tags at the end of posts, followed by links to related posts. Please let me know if this doesn&#8217;t work as intended, or if you have other comments on the change.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/12/twitter-experimentation/">Twitter Experimentation</a> <span class="related-post-date timestamp">Thu 12 Feb 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/03/19/some-rss-changes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>New Blog Functionality: Recent Commentary</title>
		<link>http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/</link>
		<comments>http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 05:39:10 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1402</guid>
		<description><![CDATA[I&#8217;ve had a Recent Comments section on the front-page sidebar of the site for quite some time, and decided it was time for an upgrade. The old version was straightforward: it displayed a list of the most recent comments and who made them. What I decided I wanted was, rather, a list of the posts [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a Recent Comments section on the front-page sidebar of the site for quite some time, and decided it was time for an upgrade. The old version was straightforward: it displayed a list of the most recent comments and who made them. What I decided I wanted was, rather, a list of the posts with the most recent comments on them, how many comments there were, and a list of the people who made the comments in timestamp order.<br />
<span id="more-1402"></span><br />
That&#8217;s what I have on the front page now. I wrote this functionality as a WordPress plugin, and will release it sometime soon&#8212;I&#8217;m not doing so yet because to work as expected it needs the user to write some CSS, so either I write docs on how to do that, or I add an option to insert some styling with the widget HTML.</p>
<p>I think it&#8217;s a better approach, because it displays more information in about the same area, and because it allows posts with discussions to remain present in the widget for longer, rather than being bumped off due to multiple comments about some single post. I think that&#8217;s likely to be more interesting.</p>
<p>At the heart of the plugin are two SQL queries that I couldn&#8217;t figure out how to turn into a single query, and which took me a little while to figure out.</p>
<p>The desired result is a list of the <em>n</em> posts with the most recent comments on them, and a list of the comments for each post, with the comment list linked to the post in some fashion. I initially thought that the first query would be easy, but I was making poor assumptions about SELECT DISTINCT that mean that I was actually getting a list of the posts with comments ordered by the time of the <em>first</em> comment, not the latest comment. Simplified somewhat, the right way to do that is this:</p>
<p><pre class="php">
SELECT wp_posts.ID, MAX(wp_comments.comment_date) as datesort
FROM comments
LEFT JOIN wp_posts ON (wp_comments.comment_post_ID = wp_posts.ID)
WHERE wp_posts.post_status = 'publish'
    AND wp_posts.post_type = 'post'
    AND wp_comments.comment_approved = 1
GROUP BY wp_posts.ID
ORDER BY datesort DESC
</pre>
</p>
<p>If, as I did initially, you use SELECT DISTINCT, or you use GROUP BY without the MAX function and sort by <strong>comment_date</strong> instead of <strong>datesort</strong>, it&#8217;s sorted by the first comment, not the latest comment.</p>
<p>From those results we have the latest posts. After putting their IDs into a comma-separated list, we can then get the comments we want:</p>
<p><pre class="php">
SELECT *
FROM wp_posts
LEFT JOIN wp_comments ON (wp_posts.ID = wp_comments.comment_post_ID)
WHERE wp_posts.ID IN ($comma_separated_list_of_post_ids)
    AND wp_comments.comment_approved = 1
ORDER BY field(wp_posts.ID, $comma_separated_list_of_post_ids), wp_comments.comment_date;
</pre>
</p>
<p>This basically means &#8220;go get the comments on the specified posts&#8221;. The only interesting part is the ordering: I wanted to get the rows back so that the comments about a given post would all be together, and it turns out that the <strong>field()</strong> function is the way to do this, as it lets you sort things by whatever arbitrary order you like: it takes the column to sort on as the first argument, and a comma-separated list of values as the arbitrary order.</p>
<p>(It turns out that I didn&#8217;t need the ordering from field(), because of the PHP that later handles this data, but I left it in the example because it&#8217;s an interesting feature.)</p>
<p>After I have the results from that query, I go through them in PHP to organize into objects that I can handle more easily, essentially placing the post data at the outermost level and the comment data corresponding to each post inside the post data (<strong>$post_ids</strong> is the array of IDs of the posts with recent comments, <strong>$recent_commentary_results</strong> is the result from the latter SQL query above):</p>
<p><pre class="php">
$recent_commentary = array();

    foreach ($post_ids as $key=>$value) {
        //Go through each post, extract the data relevant to it from the
        //query results, and add it to the array we're going to return.
        $postdata = array(
            "id"=>$value,
            "comments"=>array()
        );
        foreach ($recent_commentary_results as &#038;$row) {
            //If the row matches the current post, insert the title, the
            //comment count, and add the row itself to the list of comments
            //on that post.
            if ($value == $row->ID) {
                $postdata["title"] = $row->post_title;
                $postdata["comment_count"] = $row->comment_count;
                array_push($postdata["comments"], $row);
            }
        }
        array_push($recent_commentary, $postdata);
    }

    return $recent_commentary;
</pre>
</p>
<p>That returns the required information in a format that&#8217;s relatively easy to go through and turn into HTML; none of the rest of the plugin code is particularly interesting.</p>
<p>I hope to release the plugin later this week.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/sql/" rel="tag">SQL</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/12/twitter-experimentation/">Twitter Experimentation</a> <span class="related-post-date timestamp">Thu 12 Feb 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My WordPress Development Setup</title>
		<link>http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/</link>
		<comments>http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 00:29:20 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1359</guid>
		<description><![CDATA[One of the first things I did with my resuscitated blog was to figure out how I could develop for it in a reasonable fashion.

I&#8217;m pretty happy with the development environment at this point, the key features of which are:
Version Control: Subversion
Version control of some kind is simply necessary. If you really have to, you [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first things I did with my resuscitated blog was to figure out how I could develop for it in a reasonable fashion.<br />
<span id="more-1359"></span><br />
I&#8217;m pretty happy with the development environment at this point, the key features of which are:</p>
<h4>Version Control: Subversion</h4>
<p>Version control of some kind is simply necessary. If you really have to, you can do without something like Subversion, but there&#8217;s no real reason to&#8212;even if your host doesn&#8217;t give you shell access (in which case you should probably switch hosts), you can still use Subversion on your local machine, with your repository also running locally. That&#8217;s not an ideal situation, but it&#8217;s a lot better than no version control.</p>
<p>I strongly advise using the <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion" title=Installing/Updating WordPress with Subversion">WordPress Subversion installation procedure</a>, but with one alteration. You&#8217;re going to be keeping track of your changes in Subversion, and it&#8217;s not worth it to try to deal with svn externals for this. So instead of using <code>svn checkout</code>, use <code>svn export</code>, e.g.</p>
<p>
<pre>
svn export http://svn.automattic.com/wordpress/tags/2.7.1 .
</pre>
</p>
<p>(This also means that you should use <code>svn export</code> instead of <code>svn sw</code> when you&#8217;re upgrading.)</p>
<h4>Separate Production and Development Code Trees</h4>
<p>For small projects like this, a full suite of development, staging, and production isn&#8217;t necessary. But having both a production environment and a development environment is. These could be on separate machines, but in my case they&#8217;re on the same machine, as separate virtual hosts. Both code trees are local checkouts of the same project in Subversion. One useful trick for me was enabling error reporting on the development server:</p>
<p>
<pre>
php_value display_errors "1"
</pre>
</p>
<p>That line can be placed in either a .htaccess file or the VirtualHost section for the host. Here&#8217;s the <a href="http://us3.php.net/manual/en/ini.core.php">list of php.ini directives</a>, which tell you where they can be set/overridden.</p>
<h4>Separate Production and Development Databases</h4>
<p>You need to screw around with the WordPress database in various ways during development, and you don&#8217;t want that to alter your production site. Three simple steps will take care of this:</p>
<ul>
<li>Create a new database (named something like <code><em>yourwpdatabasename</em>_development</code>).</li>
<li>Back up the production database:
<p>
<pre>
mysqldump -u <em>MySQLusername</em> -p <em>yourwpdatabasename</em> > database_backup.sql
</pre>
</p>
</li>
<li>Alter the backup file to change the hostname from your production hostname to your development hostname. The easiest way to automate this is probably to create a file called dev_setup.sql with these lines:
<p>
<pre>
UPDATE wp_options
SET option_value="http://<em>development_wp_url</em>"
WHERE option_value = "http://<em>production_wp_url</em>";
</pre>
</p>
<p>and then use <code>cat</code> to append this to the backup file:</p>
<p>
<pre>
cat database_backup.sql dev_setup.sql > development_load.sql
</pre>
</p>
</li>
<li>Load the altered backup file into the development database:
<p>
<pre>
mysql -u <em>MySQLusername</em> -p <em>yourwp_development_databasename</em> < development_load.sql
</pre>
</p>
</li>
<li>Change the <code>wp-config.php</code> MySQL settings in the development tree:
<p>
<pre>
/** The name of the database for WordPress */
define('DB_NAME', '<em>yourwp_development_databasename</em>');

/** MySQL database username */
define('DB_USER', '<em>yourwp_development_username</em>');

/** MySQL database password */
define('DB_PASSWORD', '<em>yourwp_development_password</em>');
</pre>
</p>
<p>(The last two settings might not need to be changed.)</p>
<p>One note here is that you should make sure not to check the <code>wp-config.php</code> file in to or out of your development tree.
</li>
<h4>Focus on Theme and Plugin Files</h4>
<p>It should be possible to make more or less all the changes you want without altering anything but plugin and theme files. If you do change the core WordPress files, you'll have to be more careful with tracking updates, so unless your changes are extremely minor or you're planning on forking WordPress, stick to the plugin and theme directories. Further, new functionality should really go in plugins if possible. It requires some more work to develop, but it's far easier to maintain, and will make dealing with future moves or upgrades significantly easier.</p>
<p>So far, I've moved a 2.0 WordPress install over to 2.7, written a finished plugin and and unfinished plugin, installed several plugins, altered my theme, and installed an update (2.7 -> 2.7.1) using this environment, and it's all been quite smooth.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/">Related Posts Plugin and SQL Trickery</a> <span class="related-post-date timestamp">Tue 10 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/10/html-past-and-future/">HTML Past and Future</a> <span class="related-post-date timestamp">Tue 10 Nov 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Experimentation</title>
		<link>http://tadhg.com/wp/2009/02/12/twitter-experimentation/</link>
		<comments>http://tadhg.com/wp/2009/02/12/twitter-experimentation/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 02:00:40 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1354</guid>
		<description><![CDATA[After refusing for quite some time, I&#8217;ve decided to give Twitter a try. This might prove short-lived, but we&#8217;ll see. I like the concept of easy status updates and of disconnecting them from a larger, clunkier framework, e.g. Facebook.

I&#8217;ll experiment with them for a while and see how I like it. So far, it&#8217;s interesting [...]]]></description>
			<content:encoded><![CDATA[<p>After refusing for quite some time, I&#8217;ve decided to give <a href="http://twitter.com/tadhg_ohiggins">Twitter</a> a try. This might prove short-lived, but we&#8217;ll see. I like the concept of easy status updates and of disconnecting them from a larger, clunkier framework, e.g. Facebook.<br />
<span id="more-1354"></span><br />
I&#8217;ll experiment with them for a while and see how I like it. So far, it&#8217;s interesting enough to try integrating them with my blog, which is why there&#8217;s now a grey line at the top that says &#8220;Status:&#8221; followed by my last twitter update. The placing and look are experimental, and we&#8217;ll see whether I change that, but for the moment I think that&#8217;s where it should go.</p>
<p>I&#8217;m using Alex King&#8217;s <a href="http://wordpress.org/extend/plugins/twitter-tools/">Twitter Tools</a>, with some minor modifications (like giving the timestamp element a class of its own), to handle blog integration.</p>
<p>Apart form showing status on this blog, this will also post notifications about my blog posts to my Twitter status, which I&#8217;m not sure about. I guess it depends on how many people follow the blog but not my Twitter status, or vice versa&#8212;if there&#8217;s a lot of overlap between those two groups (as I suspect there will be) then I might disable that feature.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/twitter/" rel="tag">Twitter</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/">New Blog Functionality: Related Posts</a> <span class="related-post-date timestamp">Sun 01 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/07/10/rss-borkage/">RSS Borkage</a> <span class="related-post-date timestamp">Thu 10 Jul 2008</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/02/12/twitter-experimentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Related Posts Plugin and SQL Trickery</title>
		<link>http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/</link>
		<comments>http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 19:55:30 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1340</guid>
		<description><![CDATA[As I said I would, I&#8217;ve made a WordPress plugin out of the &#8216;related posts by tag&#8217; functionality that I use on this site.

It&#8217;s mostly very simple: all it does is look at the tags the current post has and display other posts that have overlapping tags, in order of degree of overlap.
The only tricky [...]]]></description>
			<content:encoded><![CDATA[<p>As I <a href="http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/" title="New Blog Functionality: Related Posts">said I would</a>, I&#8217;ve made a <a href="http://tadhg.com/wp/wordpress-plugins/related-posts-by-tag-widget/">WordPress plugin out of the &#8216;related posts by tag&#8217; functionality</a> that I use on this site.<br />
<span id="more-1340"></span><br />
It&#8217;s mostly very simple: all it does is look at the tags the current post has and display other posts that have overlapping tags, in order of degree of overlap.</p>
<p>The only tricky part was figuring out how to determine that overlap. My initial thought was that I would start with the complete set of tags for the post, then run a query that would see if any posts matched, then go through each set of the complete set minus one tag, and so on, e.g. if it were this post, I would first run a query to check whether or not any posts had the tech, WordPress, coding, and PHP tags, then check for posts with tech, WordPress, and coding; WordPress, coding, and PHP; tech, WordPress, and PHP, and tech, coding, and PHP&#8212;and then on through the sets of two, with a separate query for each one. This process would stop as soon as I hit whatever predefined limit was configured (ten posts, for example).</p>
<p>This wasn&#8217;t an elegant fix, but I didn&#8217;t see a way around it. However, I ran into an immediate problem, which was: how could I figure out whether a post had the tags I was checking for?</p>
<p>Simplifying slightly, the post/tag relationships are stored in a table like this one, where letters are tag IDs and numbers are post IDs:</p>
<table class="dbtable">
<thead>
<tr>
<td>tag_id</td>
<td>post_id</td>
</thead>
<tbody>
<tr>
<td>A</td>
<td>1</td>
</tr>
<td>A</td>
<td>2</td>
</tr>
<td>B</td>
<td>1</td>
</tr>
<td>C</td>
<td>1</td>
</tr>
<td>B</td>
<td>5</td>
</tr>
<td>C</td>
<td>5</td>
</tr>
<td>C</td>
<td>7</td>
</tr>
</tbody>
</table>
<p>So post <strong>1</strong> has tags <strong>A</strong>, <strong>B</strong>, and <strong>C</strong>. <strong>A</strong> also tags post <strong>2</strong>, post <strong>5</strong> has <strong>B</strong> and <strong>C</strong>, etc.</p>
<p>With that structure and using MySQL, how do you figure out what posts have a given set of tags? You don&#8217;t know the post IDs in advance. I had trouble with this, ended up trying a number of complicated nested SELECT statements, asked a few people, and didn&#8217;t get a good answer until I asked <a href="http://www.freebase.com/view/en/alexander_marks">Al Marks</a>, who came up with a good answer fairly quickly, one which used a rather different approach&#8212;instead of asking &#8220;which tags have all three relationships?&#8221;, it assigns a point value for each match:</p>
<p>
<pre class="php">
SELECT * FROM table
GROUP BY post_id
HAVING SUM(CASE WHEN tag_id IN (A, B, C) THEN 1 END) > 0;
</pre>
</p>
<p>Extremely simple: each match against any of the tags is worth a point; only return anything with more than zero points.</p>
<p>Moreover, this approach means that the whole looping I was going to have to do in PHP could be eliminated, and MySQL could return the right ordering as well:</p>
<p>
<pre class="php">
SELECT *, SUM(CASE WHEN tag_id in (A, B, C) THEN 1 END) AS matchnum FROM table
GROUP BY post_id
HAVING SUM(CASE WHEN tag_id in (A, B, C) THEN 1 END) > 0
ORDER BY matchnum DESC, date DESC;
</pre>
</p>
<p>(I know there&#8217;s no date in the example table, but I didn&#8217;t want to complicate the above code with joins.)</p>
<p>That&#8217;s it; that does more or less all of the difficult work. The select statement in my widget looks like this:</p>
<p>
<pre class="php">
SELECT $wpdb->posts.*, SUM(CASE WHEN $wpdb->term_relationships.term_taxonomy_id in (" . $comma_separated_tags_to_match . ") THEN 1 END) AS matchnum from $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)
WHERE $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->posts.ID != " . $post_id . "
GROUP BY $wpdb->term_relationships.object_id
HAVING SUM(CASE WHEN $wpdb->term_relationships.term_taxonomy_id in (" . $comma_separated_tags_to_match . ") THEN 1 END) > 0
ORDER BY matchnum DESC, $wpdb->posts.post_date " . $options['dateorder'] . "
LIMIT " . $options['fetchlimit'] . ";
</pre>
</p>
<p>I&#8217;m that SQL pattern will prove handy in future, as well&#8212;thanks Al!</p>
<p>Apart from that, the only real obstacles concerned trying to make classes work with a WordPress structure that doesn&#8217;t seem to expect to deal with them. To get around this I ended up creating some functions that did nothing but wrap calls into class functions.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/php/" rel="tag">PHP</a>, <a href="http://tadhg.com/wp/tag/sql/" rel="tag">SQL</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/12/8-bit-cities/">8-Bit Cities</a> <span class="related-post-date timestamp">Mon 12 Jul 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/02/10/related-posts-plugin-and-sql-trickery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Blog Functionality: Related Posts</title>
		<link>http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/</link>
		<comments>http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 07:37:02 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=1293</guid>
		<description><![CDATA[Having revived my proper blog and transferred my content over, I&#8217;ve now started adding improvements, some of which I&#8217;ve been wanting to add for quite some time. The first one is a list of related posts on the individual post pages.

I used to have a spot there for similar content, but it merely fetched posts [...]]]></description>
			<content:encoded><![CDATA[<p>Having revived my proper blog and transferred my content over, I&#8217;ve now started adding improvements, some of which I&#8217;ve been wanting to add for quite some time. The first one is a list of related posts on the individual post pages.<br />
<span id="more-1293"></span><br />
I used to have a spot there for similar content, but it merely fetched posts that had some tag in common with the current one. The new version selects ten posts ordered by a) the number of tags shared with the current post and b) by date (newer first). That&#8217;s a significant improvement for browsing around, and with links to both related and random posts, I think that it makes the content on the site significantly more discoverable (which is increasingly important as I add more of it; WordPress counts 919 posts on the site, not including this one).</p>
<p>Those of your reading on RSS feeds won&#8217;t get much benefit from it, but I might try to add its functionality into my feeds sometime soon.</p>
<p>I found the process of writing it interesting, and learned a small SQL pattern that I think is interesting, but that&#8217;s something <a href="/wp/2009/02/10/related-posts-plugin-and-sql-trickery/" title="Related Posts Plugin and SQL Trickery">I&#8217;ll blog about another time, probably when I release the functionality as a plugin</a>.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/blog/" rel="tag">Blog</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/23/wp-plugins-recent-commentary-and-show-tags-in-rss/">WP Plugins: Recent Commentary and Show Tags in RSS</a> <span class="related-post-date timestamp">Mon 23 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/03/19/some-rss-changes/">Some RSS Changes</a> <span class="related-post-date timestamp">Thu 19 Mar 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/23/new-blog-functionality-recent-commentary/">New Blog Functionality: Recent Commentary</a> <span class="related-post-date timestamp">Mon 23 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/12/twitter-experimentation/">Twitter Experimentation</a> <span class="related-post-date timestamp">Thu 12 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/05/24/fiction-organization/">Fiction Organization</a> <span class="related-post-date timestamp">Sun 24 May 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/02/01/new-blog-functionality-related-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Move Steps, Part Three: DNS Change</title>
		<link>http://tadhg.com/wp/2009/01/27/blog-move-steps-part-three-dns-change/</link>
		<comments>http://tadhg.com/wp/2009/01/27/blog-move-steps-part-three-dns-change/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 07:58:43 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=944</guid>
		<description><![CDATA[I&#8217;ve wrangled my old plugins and custom code so that it mostly works, except for one or two features (such as &#8220;related posts&#8221; based on tags) that I&#8217;ll revive later. Good enough for now, so I&#8217;m making the DNS changes and going ahead.
If you&#8217;re seeing this text, you&#8217;re on the new server, and all should [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wrangled my old plugins and custom code so that it mostly works, except for one or two features (such as &#8220;related posts&#8221; based on tags) that I&#8217;ll revive later. Good enough for now, so I&#8217;m making the DNS changes and going ahead.</p>
<p><strong>If you&#8217;re seeing this text, you&#8217;re on the new server, and all should be well. But if you don&#8217;t see another post after this one by about Friday, it suggests RSS problems, so please drop me a line.</strong></p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/web-development/" rel="tag">web-development</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/14/wordpress-2-8-upgrade/">WordPress 2.8 Upgrade</a> <span class="related-post-date timestamp">Sun 14 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/13/my-wordpress-development-setup/">My WordPress Development Setup</a> <span class="related-post-date timestamp">Fri 13 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/01/26/blog-move-steps-part-two/">Blog Move Steps, Part Two</a> <span class="related-post-date timestamp">Mon 26 Jan 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/01/25/blog-move-steps-part-one/">Blog Move Steps, Part One</a> <span class="related-post-date timestamp">Sun 25 Jan 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/02/09/simple-wordpress-anti-spam-plugin/">Simple WordPress Anti-Spam Plugin</a> <span class="related-post-date timestamp">Fri 09 Feb 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/30/2010-goals-first-quarter-review/">2010 Goals: First Quarter Review</a> <span class="related-post-date timestamp">Tue 30 Mar 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2009/01/27/blog-move-steps-part-three-dns-change/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
