<?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>Two Seven &#187; Wordpress</title>
	<atom:link href="http://twoseven.co.nz/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://twoseven.co.nz</link>
	<description>...is Dan Willis blogging about web design and development, usability, standards and pretty much anything!</description>
	<lastBuildDate>Wed, 08 Feb 2012 03:27:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-20339</generator>
		<item>
		<title>Pears: Create your own pattern library</title>
		<link>http://twoseven.co.nz/2012/02/08/pears-create-your-own-pattern-library/</link>
		<comments>http://twoseven.co.nz/2012/02/08/pears-create-your-own-pattern-library/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 03:27:06 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://twoseven.co.nz/?p=228</guid>
		<description><![CDATA[At work, we have what we call our module library, which is an interface with which to browse (and edit) the snippets of code and style (we call them modules) that we use to make up our site. They&#8217;re not &#8230; <a href="http://twoseven.co.nz/2012/02/08/pears-create-your-own-pattern-library/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At work, we have what we call our <em>module library</em>, which is an interface with which to browse (and edit) the snippets of code and style (we call them <em>modules</em>) that we use to make up our site. They&#8217;re not templates, as such, but rather starting points for the blocks with which we build our pages.</p>
<p>Dan Cederhom of <a href="http://simplebits.com/">Simplebits</a> has just announced his release of a WordPress theme that you can use to create your own pattern library.</p>
<p>It&#8217;s called <a href="http://pea.rs/">Pears</a>. </p>
<p>He&#8217;s hosting it on <a href="https://github.com/simplebits/Pears">github</a>, so you can tweak/improve it as you will.</p>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2012/02/08/pears-create-your-own-pattern-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New.</title>
		<link>http://twoseven.co.nz/2008/03/31/the-new/</link>
		<comments>http://twoseven.co.nz/2008/03/31/the-new/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 19:30:22 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://twoseven.co.nz/2008/03/31/the-new/</guid>
		<description><![CDATA[WordPress 2.5 is! Check it out now.]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.5 is!</p>
<p><a href="http://wordpress.org/download/" title="&hellip;the funk soul brother">Check it out now</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2008/03/31/the-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quoted WordPress frustration</title>
		<link>http://twoseven.co.nz/2007/10/04/quoted-wordpress-frustration/</link>
		<comments>http://twoseven.co.nz/2007/10/04/quoted-wordpress-frustration/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 18:54:37 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://twoseven.co.nz/2007/10/04/quoted-wordpress-frustration/</guid>
		<description><![CDATA[&#8230;from Dan Cederholm: &#8220;if you tell me again that this tag must be used inside The Loop, I will destroy you.&#8221; [via Twitter]]]></description>
			<content:encoded><![CDATA[<p>&#8230;from <a href="http://simplebits.com/" title="Dan Cederholm's SImplebits">Dan Cederholm</a>: </p>
<blockquote><p>&#8220;if you tell me again that this tag must be used inside The Loop, I will destroy you.&#8221;</p></blockquote>
<p>[<a href="http://twitter.com/simplebits/statuses/309714012">via Twitter</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2007/10/04/quoted-wordpress-frustration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More WordPress title modification</title>
		<link>http://twoseven.co.nz/2007/09/11/more-wordpress-title-modification/</link>
		<comments>http://twoseven.co.nz/2007/09/11/more-wordpress-title-modification/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 21:44:35 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://twoseven.co.nz/2007/09/11/more-wordpress-title-modification/</guid>
		<description><![CDATA[Some time ago I wrote about re-working WordPress titles to make them easier to read, and more search engine-friendly. Since then I&#8217;ve done a bit more work on WordPress, and so I thought I&#8217;d share a few WordPress title modications &#8230; <a href="http://twoseven.co.nz/2007/09/11/more-wordpress-title-modification/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago <a href="http://twoseven.co.nz/2007/02/15/wordpress-titles/" title="twoseven.co.nz: WordPress titles">I wrote about re-working WordPress titles</a> to make them easier to read, and more search engine-friendly.</p>
<p>Since then I&#8217;ve done a bit more work on WordPress, and so I thought I&#8217;d share a few WordPress title modications I&#8217;ve used in a recent project.<span id="more-48"></span></p>
<p>I&#8217;m also going to throw in some <code>&lt;h1&gt;</code> modifications, since <code>&lt;h1&gt;</code> and <code>&lt;title&gt;</code> contents are fairly similar.</p>
<h3>The <code>&lt;title&gt;</code></h3>
<p><a href="http://twoseven.co.nz/2007/02/15/wordpress-titles/" title="twoseven.co.nz: WordPress titles">Read this first</a>. </p>
<p>You got that? Good.<br />
Okay, so what I did was take the reshuffled code, as follows:</p>
<p><code>&lt;title&gt;
&lt;?php wp_title(' '); ?&gt; &lt;?php if(wp_title(' ', false)) { echo ' - '; } ?&gt; &lt;?php bloginfo('name'); ?&gt;
&lt;/title&gt;</code></p>
<p>&#8230; and prepended a piece of code to check if this is a search page, and if so, show the search query, like this: <code>&lt;?php if (is_search()){ ?&gt; Search for "&lt;?php the_search_query(); ?&gt;" - &lt;?php } ?&gt;</code> </p>
<p>So we get:</p>
<p><code>&lt;title&gt;
&lt;?php if (is_search()){ ?&gt; Search for "&lt;?php the_search_query(); ?&gt;" - &lt;?php } ?&gt; &lt;?php wp_title(' '); ?&gt; &lt;?php if(wp_title(' ', false)) { echo ' - '; } ?&gt; &lt;?php bloginfo('name'); ?&gt;
&lt;/title&gt;</code></p>
<p>So if you did a search for &#8220;free iPhones&#8221;, your browser&#8217;s title bar would show:</p>
<blockquote><p>&#8220;Search for &#8220;Free iPhones&#8221; &#8211; Your Site Name&#8221;</p></blockquote>
<p>It&#8217;s nothing amazing, but just makes the <code>&lt;title&gt;</code> that much more useful.</p>
<h3>The <code>&lt;h1&gt;</code></h3>
<p>This is a unique title for a given page.<br />
There should be &mdash; according to me, anyway &mdash; just one <code>&lt;h1&gt;</code> element per page.</p>
<p>Here&#8217;s some code to look at:</p>
<p><code>&lt;h1&gt;&lt;?php if (!is_home()) { ?&gt;&lt;a href="&lt;?php echo get_bloginfo('url'); ?&gt;" title="Back to the home page"&gt;&lt;?php if (is_search()){ ?&gt; Search for "&lt;?php the_search_query(); ?&gt;" - &lt;?php } ?&gt;&lt;?php wp_title(' '); ?&gt;&lt;?php if(wp_title(' ', false)) { echo ' - '; } ?&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;?php } else {  bloginfo('name'); } ?&gt;&lt;/h1&gt;</code></p>
<p>Well, that&#8217;s rather hard on the eyes, isn&#8217;t it? One day I&#8217;ll move this blog off the default WordPress template and onto something that makes code chunks look better.</p>
<p>It&#8217;s all wrapped in an &#8216;if&#8217; statement that checks to see if this is the home page. If it is, then the <code>&lt;h1&gt;</code> contains just the name of the site:<br />
<code>bloginfo('name');</code></p>
<p>If this is not the home page, then the <code>&lt;h1&gt;</code> element contains the page title as per the <code>&lt;title&gt;</code> element above, wrapped in an <code>&lt;a&gt;</code> element that links back to the home page:<br />
<code>&lt;?php if (!is_home()) { ?&gt;&lt;a href="&lt;?php echo get_bloginfo('url'); ?&gt;" title="Back to the home page"&gt; ... title code ... &lt;/a&gt;&lt;?php } else {  bloginfo('name'); } ?&gt;</code></p>
<p>So there you have it.</p>
<p>Again, I&#8217;m sorry this is so hard to read; maybe one day I&#8217;ll go into a bit more detail.<br />
Let me know if anything here requires further clarification.</p>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2007/09/11/more-wordpress-title-modification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress category names and SEO: fixing a typo</title>
		<link>http://twoseven.co.nz/2007/09/10/wordpress-category-names-and-seo-fixing-a-typo/</link>
		<comments>http://twoseven.co.nz/2007/09/10/wordpress-category-names-and-seo-fixing-a-typo/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 02:05:15 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Search Engineering]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://twoseven.co.nz/2007/09/10/wordpress-category-names-and-seo-fixing-a-typo/</guid>
		<description><![CDATA[The problem So you&#8217;ve made a typo in your WordPress category. It&#8217;s easy to log in to your WordPress administration site and correct the category name, right? Yep, but that&#8217;s only half the job done; any existing external links to &#8230; <a href="http://twoseven.co.nz/2007/09/10/wordpress-category-names-and-seo-fixing-a-typo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3 id="problem">The problem</h3>
<p>So you&#8217;ve made a typo in your WordPress category.</p>
<p>It&#8217;s easy to log in to your WordPress administration site and correct the category name, right? </p>
<p>Yep, but that&#8217;s only half the job done; <span id="more-45"></span>any existing external links to posts in that category will still have the old incorrect category in the URL, and will now return a 404 error, i.e. the links will now be broken.</p>
<h3 id="solution">The solution</h3>
<p>What you need to do is create a redirect from the old incorrectly spelled URL to the nice new one.<br />
To create this redirect you&#8217;ll need to be able to modify your site&#8217;s <strong>.htaccess</strong> file (NB: this only works for Apache web servers).<br />
You&#8217;ll find it in the root folder of your site. You can access it via FTP, or through your web host&#8217;s administration interface, if you have one.</p>
<p>So, once you&#8217;ve got it open, you&#8217;ll see some existing rules: you can ignore these.</p>
<p>Look for this section:</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On

... (some other stuff here)

&lt;/IfModule&gt;</code></pre>
<p>If it doesn&#8217;t exist, you&#8217;ll need to add it.</p>
<p>Between the <code>&lt;IfModule&gt;</code> tags, append the following line:</p>
<pre><code>Redirect 301 /rwong http://yoursite.com/wrong</code></pre>
<p>&#8230;and when you save your .htaccess file, your old incorrect URLs should still work!</p>
<h3 id="explanation">The explanation</h3>
<p>Let&#8217;s break down each part of this new line:</p>
<h4>Redirect</h4>
<p>This is a directive for your web server; it tells it what to do with what comes next.</p>
<h4>301</h4>
<p>This is the type of redirect to execute. A &#8217;301&#8242; is a permanent redirect &#8211; this tells Google (and anyone else) that this resource had moved permanently. (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" title="HTTP/1.1 Status Code Definitions">Here&#8217;s a list of HTTP status codes</a> for your reference.)</p>
<h4>/rwong</h4>
<p>This string is the trigger for the redirect, i.e. the incorrectly spelled part of your URL.</p>
<h4>http://yoursite.com/wrong</h4>
<p>&#8230;and this is the correct URL to redirect to.</p>
<h3 id="conclusion">In conclusion</h3>
<p>So to wrap it all up, you should have something that looks like this:</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On

... (some other stuff here)

Redirect 301 /rwong http://yoursite.com/wrong
&lt;/IfModule&gt;</code></pre>
<p>I hope you might find this useful.<br />
Please comment if you&#8217;ve got something to ask, something to add or if you know of a better way to do this.</p>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2007/09/10/wordpress-category-names-and-seo-fixing-a-typo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress titles</title>
		<link>http://twoseven.co.nz/2007/02/15/wordpress-titles/</link>
		<comments>http://twoseven.co.nz/2007/02/15/wordpress-titles/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 05:36:54 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.twoseven.co.nz/2007/02/15/wordpress-titles/</guid>
		<description><![CDATA[So there&#8217;s problems with the default WordPress page titles; the display order, and the separator. We&#8217;re going to take a look at those problems &#8211; why are they problems? &#8211; and we&#8217;ll examine some solutions. The problem with default WordPress &#8230; <a href="http://twoseven.co.nz/2007/02/15/wordpress-titles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So there&#8217;s problems with the default WordPress page titles; the display order, and the separator. We&#8217;re going to take a look at those problems &#8211; why are they problems? &#8211; and we&#8217;ll examine some solutions.<br />
<span id="more-3"></span></p>
<h3>The problem with default WordPress titles</h3>
<p>The default WordPress title displays something like this:</p>
<blockquote><p>[blog name] » [category name] » [post title]</p></blockquote>
<p>There are two key problems here:</p>
<ol>
<li><strong>Item order:</strong> The order of the items in the title should read from most specific to least specific (left-to-right). So the post title should be first, and the blog title should be last. This makes them more readable and useful in lists of favourites, for example.</li>
<li><strong>The separator:</strong> The separator shouldn&#8217;t be anything that needs to be escaped and it should be something that comes out nice in screenreaders, too. <a href="http://www.456bereastreet.com/archive/200410/document_titles_and_title_separators/" title="Document titles and title separators">Here&#8217;s an article</a> at <a href="http://www.456bereastreet.com/" title="Roger Johansson's 456 Berea Street">456 Berea Street</a> regarding document titles and separators. I find <a href="http://www.456bereastreet.com/archive/200410/document_titles_and_title_separators/#comment9">this comment</a> in particular to be most useful.</li>
</ol>
<h3>The solution</h3>
<p>Let&#8217;s take a look at the standard code:</p>
<p><code>&lt;title&gt;
&lt;?php bloginfo('name'); ?&gt;
&lt;?php if ( is_single() ) { ?&gt; &amp;raquo; Blog Archive &lt;?php } ?&gt; 
&lt;?php wp_title(); ?&gt;
&lt;/title&gt;</code></p>
<p>We&#8217;ll reshuffle this as follows:</p>
<p><code>&lt;title&gt;
&lt;?php wp_title(' '); ?&gt;
&lt;?php if(wp_title(' ', false)) { echo ' - '; } ?&gt;
&lt;?php bloginfo('name'); ?&gt;
&lt;/title&gt;</code></p>
<p>So you can see the title of the current page/post comes first. &#8216;wp_title&#8217; takes an empty string as a parameter; this parameter denotes the separator. We&#8217;re not using the default, and since we&#8217;ve reversed the order, we don&#8217;t need to display a separator at all.</p>
<p>We then have an &#8216;if&#8217; statement that checks if the &#8216;wp-title&#8217; holds a value and displays a separator, &#8216; &#8211; &#8216;, if it does.</p>
<p>Lastly, we display the name of the blog with bloginfo(&#8216;name&#8217;).</p>
<p>So now we get this in our title bar:</p>
<blockquote><p>[post title] &#8211; [category name] &#8211; [blog name]</p></blockquote>
<p>Much friendlier!</p>
<h3>Some useful links</h3>
<ul>
<li><a href="http://www.456bereastreet.com/archive/200410/document_titles_and_title_separators/" title="Document titles and title separators">Document titles and title separators</a>.</li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_title" title="Template Tags/wp title &laquo; WordPress Codex">Template Tags/wp title</a> &#8211; from the WordPress  documentation</li>
<li><a href="http://www.julian-bez.de/blog/2005/02/15/how-to-use-the-title-tag/" title="How to use the title tag">How to use the title tag</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://twoseven.co.nz/2007/02/15/wordpress-titles/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

