<?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>Rob Allen&#039;s DevNotes &#187; WordPress</title>
	<atom:link href="http://akrabat.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Fri, 11 May 2012 12:52:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Shorter Link: A rev=canonical WordPress plugin</title>
		<link>http://akrabat.com/wordpress/shorter-link-a-revcanonical-wordpress-plugin/</link>
		<comments>http://akrabat.com/wordpress/shorter-link-a-revcanonical-wordpress-plugin/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 18:30:40 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=481</guid>
		<description><![CDATA[Hot on the heels of my No DiggBar, I've created another extension for WordPress! Shorter Links provides a &#60;link&#62; tag in the &#60;head&#62; section of your page with a shorter url and appropriate tags for use with the new revCanonical system. Further details can be found at laughingmeme.org, shiflett.org or benramsey.com. The link created looks [...]]]></description>
			<content:encoded><![CDATA[<p>Hot on the heels of my <a href="/no-diggbar">No DiggBar</a>, I've created another extension for WordPress!</p>
<p><a href="/shorter-links">Shorter Links</a> provides a &lt;link&gt; tag in the &lt;head&gt; section of your page with a shorter url and appropriate tags for use with the new <a href="http://revcanonical.appspot.com/">revCanonical</a> system. Further details can be found at <a href="http://laughingmeme.org/2009/04/03/url-shortening-hinting/">laughingmeme.org</a>, <a href="http://shiflett.org/blog/2009/apr/save-the-internet-with-rev-canonical">shiflett.org</a> or <a href="http://benramsey.com/archives/summarizing-my-revcanonical-argument/">benramsey.com</a>.</p>
<p>The link created looks like this:</p>
<link rev="canonical" rel="alternate shorter" href="{shorter url}" />
<p>By default, the shorter url is simply {your domain}/{post id}, but the plugin also creates a custom field called "Shorter link" once a post is saved, so that you can change the shorter link to a more memorable set of characters.</p>
<p>Rather handily, Simon Willison, has produced a <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">bookmarklet called Shorten</a> so you can find out if the page you are looking at has a shorter link or not.</p>
<p>As an example, my  <a href="http://akrabat.com/zend-framework-tutorial">Zend Framework Tutorial</a> page has a canonical URL of <tt>http://akrabat.com/zend-framework-tutorial</tt>. I have set up a Shorter Link of <tt>http://akrabat.com/zft</tt> which will redirect to the correct page. The &lt;link&gt; tag for this is:<br />
<tt>&lt;link rev="canonical" rel="alternate shorter" href="http://akrabat.com/zft" /&gt;</tt></p>
<p>Why not <a href="http://akrabat.com/shorter-links">download Shorter Links</a> and have a play?</p>
<p>Update, the latest version uses rel="shorturl".</p>
 <p><a href="http://akrabat.com/?flattrss_redirect&amp;id=481&amp;md5=8c7f03db90867d40a43cc2e403cbda07" title="Flattr" target="_blank"><img src="http://akrabat.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/wordpress/shorter-link-a-revcanonical-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=akrabat&amp;popout=1&amp;url=http%3A%2F%2Fakrabat.com%2Fwordpress%2Fshorter-link-a-revcanonical-wordpress-plugin%2F&amp;language=en_GB&amp;category=text&amp;title=Shorter+Link%3A+A+rev%3Dcanonical+WordPress+plugin&amp;description=Hot+on+the+heels+of+my+No+DiggBar%2C+I%27ve+created+another+extension+for+WordPress%21+Shorter+Links+provides+a+%26lt%3Blink%26gt%3B+tag+in+the+%26lt%3Bhead%26gt%3B+section+of+your+page+with+a+shorter...&amp;tags=blog" type="text/html" />
	</item>
		<item>
		<title>Digg bar blocker for WordPress</title>
		<link>http://akrabat.com/wordpress/digg-bar-blocker-for-wordpress/</link>
		<comments>http://akrabat.com/wordpress/digg-bar-blocker-for-wordpress/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 09:00:56 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=448</guid>
		<description><![CDATA[The DiggBar is a URL shortening service that puts your website within a frame on digg.com. As a result, the user sees Digg's URL, rather than your URL in their address bar, no matter which page they navigate to on your site. I don't particularly like this, so I've written a small plugin for WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>The DiggBar is a URL shortening service that puts your website within a frame on digg.com. As a result, the user sees Digg's URL, rather than your URL in their address bar, no matter which page they navigate to on your site.</p>
<p>I don't particularly like this, so I've written a small plugin for WordPress that removes it. Go to the <a href="/no-diggbar">No DiggBar page</a> to download it.</p>
<p>Tip of the hat to J<a href="http://daringfireball.net/2009/04/how_to_block_the_diggbar">ohn Gruber</a> for the idea.</p>
<p><strong>Update:</strong> The No DiggBar plugin is now available from the WordPress Plugin Directory: <a href="http://wordpress.org/extend/plugins/no-diggbar/">http://wordpress.org/extend/plugins/no-diggbar</a></p>
 <p><a href="http://akrabat.com/?flattrss_redirect&amp;id=448&amp;md5=0cb041bf79ab08552aee9d2e9aabf2f4" title="Flattr" target="_blank"><img src="http://akrabat.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/wordpress/digg-bar-blocker-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=akrabat&amp;popout=1&amp;url=http%3A%2F%2Fakrabat.com%2Fwordpress%2Fdigg-bar-blocker-for-wordpress%2F&amp;language=en_GB&amp;category=text&amp;title=Digg+bar+blocker+for+WordPress&amp;description=The+DiggBar+is+a+URL+shortening+service+that+puts+your+website+within+a+frame+on+digg.com.+As+a+result%2C+the+user+sees+Digg%27s+URL%2C+rather+than+your+URL+in+their...&amp;tags=blog" type="text/html" />
	</item>
		<item>
		<title>Fixing -- in WordPress</title>
		<link>http://akrabat.com/wordpress/fixing-in-wordpress/</link>
		<comments>http://akrabat.com/wordpress/fixing-in-wordpress/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 12:50:53 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=413</guid>
		<description><![CDATA[One thing that I've noticed is that whenever I used -- in a post, such as this one, WordPress converted the -- to &emdash; which whilst very pretty doesn't work so well for people trying to understand command line switches to ./configure! Today, I finally got around to poking into the WP source code to [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that I've noticed is that whenever I used -- in a post, such as <a href="/2009/03/05/setting-up-php-on-os-x-leopard/">this one</a>, WordPress converted the -- to &emdash; which whilst very pretty doesn't work so well for people trying to understand command line switches to <tt>./configure</tt>!</p>
<p>Today, I finally got around to poking into the WP source code to work out what was happening and I tracked it down to the <tt>wptexturize</tt> function in the <tt>wp-includes/functions-formatting.php</tt> file. Once I knew the name, it was trivial to google for a solution and I found Jason Litka's <a href="http://www.jasonlitka.com/2007/09/25/wordpress-plugin-disable-wptexturize/">Disable wptexturize</a> plugin. I couldn't find it through WordPress' new built-in plugin installer, so I installed it the old-fashioned way and now the code in my posts will make more sense!</p>
 <p><a href="http://akrabat.com/?flattrss_redirect&amp;id=413&amp;md5=b76c864c79ade5c4940f61e2577162ba" title="Flattr" target="_blank"><img src="http://akrabat.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/wordpress/fixing-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=akrabat&amp;popout=1&amp;url=http%3A%2F%2Fakrabat.com%2Fwordpress%2Ffixing-in-wordpress%2F&amp;language=en_GB&amp;category=text&amp;title=Fixing+--+in+WordPress&amp;description=One+thing+that+I%27ve+noticed+is+that+whenever+I+used+--+in+a+post%2C+such+as+this+one%2C+WordPress+converted+the+--+to+%26emdash%3B+which+whilst+very+pretty+doesn%27t+work...&amp;tags=blog" type="text/html" />
	</item>
		<item>
		<title>post2cat doesn&#039;t exist after upgrading WordPress</title>
		<link>http://akrabat.com/wordpress/post2cat-and-wordpress/</link>
		<comments>http://akrabat.com/wordpress/post2cat-and-wordpress/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 15:23:25 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://akrabat.com/2007/11/10/wordpress/</guid>
		<description><![CDATA[Note to help anyone else who has the same problem! If you are a "little behind" the times when you upgrade you WordPress installation, you may see errors like this: WordPress database error: [Table 'xxx.wp_post2cat' doesn't exist] SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM `wp_posts` p LEFT JOIN `wp_post2cat` pc ON p.ID = pc.post_id [...]]]></description>
			<content:encoded><![CDATA[<p>Note to help anyone else who has the same problem!</p>
<p>If you are a "little behind" the times when you upgrade you WordPress installation, you may see errors like this:</p>
<blockquote><p>
WordPress database error: [Table 'xxx.wp_post2cat' doesn't exist]<br />
SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM `wp_posts` p<br />
LEFT JOIN `wp_post2cat` pc ON p.ID = pc.post_id<br />
LEFT JOIN `wp_categories` c ON pc.category_id = c.cat_ID<br />
WHERE post_status = 'publish' GROUP BY cat_
</p></blockquote>
<p>This is because the tables used for storing categories has been changed and the old ones (wp_post2cat and friends) have been deleted and you have some old code in a plugin or your theme that uses it.</p>
<p>In my case it was this <a href="http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/">Google Sitemap Generator Plugin</a> which was updated back when WordPress 2.1 was released, so the fault is clearly all mine!  One thing that was interesting is that the plugin page within the WordPress admin system didn't tell me that I needed to upgrade that plugin, but it did tell me about others.</p>
 <p><a href="http://akrabat.com/?flattrss_redirect&amp;id=198&amp;md5=98a28af04b1a859ea1a0fc22591eabc2" title="Flattr" target="_blank"><img src="http://akrabat.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/wordpress/post2cat-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=akrabat&amp;popout=1&amp;url=http%3A%2F%2Fakrabat.com%2Fwordpress%2Fpost2cat-and-wordpress%2F&amp;language=en_GB&amp;category=text&amp;title=post2cat+doesn%27t+exist+after+upgrading+WordPress&amp;description=Note+to+help+anyone+else+who+has+the+same+problem%21+If+you+are+a+%22little+behind%22+the+times+when+you+upgrade+you+WordPress+installation%2C+you+may+see+errors+like+this%3A...&amp;tags=blog" type="text/html" />
	</item>
		<item>
		<title>WordPress 2.0 Rewrite Rules</title>
		<link>http://akrabat.com/wordpress/wordpress-20-rewrite-rules/</link>
		<comments>http://akrabat.com/wordpress/wordpress-20-rewrite-rules/#comments</comments>
		<pubDate>Wed, 18 Jan 2006 21:35:03 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.akrabat.com/2006/01/18/wordpress-20-rewrite-rules/</guid>
		<description><![CDATA[We recently upgraded my wife's blog from WordPress 1.5 to 2.0 and it broke the mod_rewrite rules used to support the legacy Movable Type urls. When she migrated from Movable Type to WordPress, we moved to /{year}/{month}/{day}/{slug} type urls from the default Movable Type rule of /archives/{id}.html. We read the manual at the time and [...]]]></description>
			<content:encoded><![CDATA[<p>We recently upgraded my wife's blog from WordPress 1.5 to 2.0 and it broke the mod_rewrite rules used to support the legacy Movable Type urls.  When she migrated from Movable Type to WordPress, we moved to /{year}/{month}/{day}/{slug} type urls from the default Movable Type rule of /archives/{id}.html. We read the manual at the time and put the following into the .htaccess file:</p>
<blockquote style="color:#333; margin-left: 10px; padding: 0;"><pre class="phpcode"><span style="color: #0000BB">RewriteRule&nbsp;archives</span><span style="color: #007700">/</span><span style="color: #0000BB">0</span><span style="color: #007700">*(</span><span style="color: #0000BB">d</span><span style="color: #007700">+).</span><span style="color: #0000BB">html&nbsp;</span><span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">?</span><span style="color: #0000BB">p</span><span style="color: #007700">=$</span><span style="color: #0000BB">1
RewriteRule&nbsp;index</span><span style="color: #007700">.</span><span style="color: #0000BB">rdf&nbsp;</span><span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">?</span><span style="color: #0000BB">feed</span><span style="color: #007700">=</span><span style="color: #0000BB">rdf
RewriteRule&nbsp;index</span><span style="color: #007700">.</span><span style="color: #0000BB">rss&nbsp;</span><span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">?</span><span style="color: #0000BB">feed</span><span style="color: #007700">=</span><span style="color: #0000BB">rss
RewriteRule&nbsp;index</span><span style="color: #007700">.</span><span style="color: #0000BB">xml&nbsp;</span><span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">?</span><span style="color: #0000BB">feed</span><span style="color: #007700">=</span><span style="color: #0000BB">rss2</span>
</span></code></pre>
</blockquote>
<p>and all was well...  </p>
<p>Then we upgraded to WordPress 2.0.</p>
<p>They stopped working because WordPress 2.0 does it's own mod_rewrite. I worked my way through the source code and modifed the core stuff and got it working. Then I started trying to find out how to do it properly without modifying the WordPress source code. I finally found a post on the support forums from someone trying to do something similar and modifed the solution to work for me:</p>
<p>Add the following to a file called functions.php in your theme directory:</p>
<blockquote style="color:#333; margin-left: 10px; padding: 0;"><pre>function mt_filter($rules)
{
    $rules['archives/0*(\d+).html']
                = 'index.php?p=$matches[1]';
    $rules['index.rdf'] = 'index.php?feed=rdf';
    $rules['index.rss'] = 'index.php?feed=rss';
    $rules['index.xml'] = 'index.php?feed=rss2';
    return $rules;
}
add_filter('rewrite_rules_array', 'mt_filter');</pre>
</blockquote>
<p>and that's all there is to it.</p>
<p>Fairly obvious I would think if you know how WordPress works. There's probably a very handy article somewhere on wordpress.org detailling this, but I couldn't find it... probably didn't look hard enough!</p>
 <p><a href="http://akrabat.com/?flattrss_redirect&amp;id=17&amp;md5=258dbbbf8d4b7012e364e66313d7828a" title="Flattr" target="_blank"><img src="http://akrabat.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/wordpress/wordpress-20-rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=akrabat&amp;popout=1&amp;url=http%3A%2F%2Fakrabat.com%2Fwordpress%2Fwordpress-20-rewrite-rules%2F&amp;language=en_GB&amp;category=text&amp;title=WordPress+2.0+Rewrite+Rules&amp;description=We+recently+upgraded+my+wife%27s+blog+from+WordPress+1.5+to+2.0+and+it+broke+the+mod_rewrite+rules+used+to+support+the+legacy+Movable+Type+urls.+When+she+migrated+from+Movable...&amp;tags=blog" type="text/html" />
	</item>
	</channel>
</rss>

