<?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>design is philosophy &#187; wordpress</title>
	<atom:link href="http://www.designisphilosophy.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designisphilosophy.com</link>
	<description>WordPress, Expression Web, CSS, other stuff</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:10:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.designisphilosophy.com/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using the time tag in WordPress and when parsing RSS feeds</title>
		<link>http://www.designisphilosophy.com/wordpress/using-the-time-tag-in-wordpress-and-when-parsing-rss-feeds/</link>
		<comments>http://www.designisphilosophy.com/wordpress/using-the-time-tag-in-wordpress-and-when-parsing-rss-feeds/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 03:10:02 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1767</guid>
		<description><![CDATA[The &#60;time&#62; tag is a little used but very effective little HTML element that allows you to embed additional information to dates and times in your content. The idea is that in addition to the actual text that shows the &#8230; <a href="http://www.designisphilosophy.com/wordpress/using-the-time-tag-in-wordpress-and-when-parsing-rss-feeds/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The &lt;time&gt; tag is a little used but very effective little HTML element that allows you to embed additional information to dates and times in your content. The idea is that in addition to the actual text that shows the visitor the time, you can provide the browser, search engines and other computers with actual time information they can understand. Very cool.</p>
<p>For a recent project I had to parse time tags both from WordPress and from an RSS feed. After some mucking about I found what I think is the optimal solution, so to save you some time I&#8217;ve put it all together for you.</p>
<h2>Date stamp for WordPress using the &lt;time&gt; tag</h2>
<p>WordPress can output the publishing date and time in pretty much any configuration you want. For the time tag to work you need the datetime variable to show the time in a specific format that looks like this:</p>
<p>2012-01-30T18:55:21+08:00</p>
<p>That&#8217;s year, month, date, time (international) and an optional time zone reference. I&#8217;m in Vancouver, Canada so that&#8217;s GMT+8 hours.</p>
<p>Using the <a href="http://codex.wordpress.org/Function_Reference/get_the_date" title="get_the_date at the WordPress Codex" target="_blank">get_the_date()</a> function in WordPress you can get this time format and any other. In this case I wanted the format &#8220;Jan. 30, 2012&#8243;.</p>
<p>The end result:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;time class=&quot;entry-date&quot; datetime=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_date<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'c'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; pubdate&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M. j, Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/time&gt;</pre></div></div>

<h2>Date stamp when parsing RSS feeds using the &lt;time&gt; tag</h2>
<p>For the project I also needed to parse an RSS feed and show the details of each item in an index page. RSS feeds output the date in a standardized format, but it is rather unsightly:</p>
<p>2012-01-30T23:00:00+00:00</p>
<p>I needed to get this parsed to match the example above. To do so I used a <a href="http://www.handyphp.com/index.php/PHP-Resources/Handy-PHP-Functions/reformat_date.html" title="Reformat Date with PHP" target="_blank">handy PHP function provided by Handy PHP called Reformat Date</a>. This function uses the <a href="http://php.net/manual/en/function.strtotime.php" title="strtotime PHP function" target="_blank">strtotime()</a> PHP function to reformat dates into anything you want simply and easily.</p>
<p>First I added the function itself to the functions.php file in my theme like this (notice I append the name of the theme at the front of the function name to avoid any future clashes should WordPress decide to bake this feature in):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Reformat date for RSS feed</span>
<span style="color: #000000; font-weight: bold;">function</span> theme_reformat_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Function written by Marcus L. Griswold (vujsa)</span>
<span style="color: #666666; font-style: italic;">// Can be found at http://www.handyphp.com</span>
<span style="color: #666666; font-style: italic;">// Do not remove this header!</span>
&nbsp;
    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Second I grabbed the RSS feed using WordPress&#8217; native RSS import function (I&#8217;ll write about that in a separate post but it&#8217;s pretty straight forward) and then I parsed the data. </p>
<p>Note: In an RSS feed the time is contained in each item under the handle pubdate so to get the raw time I use $item['pubdate'].</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;time class=&quot;entry-date&quot; datetime=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> theme_reformat_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pubdate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; pubdate&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> theme_reformat_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pubdate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'M. j, Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/time&gt;</pre></div></div>

<p>Note that the date has to be reformatted twice, once for machine readable output (&#8216;c&#8217;) and once for the human readable output (&#8216;M. j, Y&#8217;).</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress/using-the-time-tag-in-wordpress-and-when-parsing-rss-feeds/' addthis:title='Using the time tag in WordPress and when parsing RSS feeds' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/using-the-time-tag-in-wordpress-and-when-parsing-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress on Windows Azure &#8211; a bit of history</title>
		<link>http://www.designisphilosophy.com/wordpress/wordpress-on-windows-azure-a-bit-of-history/</link>
		<comments>http://www.designisphilosophy.com/wordpress/wordpress-on-windows-azure-a-bit-of-history/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 00:58:38 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress on Azure]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1507</guid>
		<description><![CDATA[In February 2011 I had the fortune of getting a meeting with Alessandro Catrioni, head of the Azure Interop team at Microsoft. We had a long chat about the possibility of creating a persistent, scaleable WordPress Networks solution that could run natively &#8230; <a href="http://www.designisphilosophy.com/wordpress/wordpress-on-windows-azure-a-bit-of-history/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In February 2011 I had the fortune of getting a meeting with Alessandro Catrioni, head of the Azure Interop team at Microsoft. We had a long chat about the possibility of creating a persistent, scaleable WordPress Networks solution that could run natively on Windows Azure. A bit like trying to boil the ocean, but we knew it was technically possible. Last Friday, the first fully functioning version of this crazy idea went live and we were able to run multiple WordPress sites from one core installation as a native Windows Azure application utilizing an Azure instance, a SQL Azure database, Azure Blob Storage and the Azure DNS.</p>
<p>It may not sound like much, but this is big. As in you can make your own WordPress.com. In the cloud. With infinite scaleability and redundancy. Without managing your own server.</p>
<h2>The Idea</h2>
<p>As with many other WordPress developers one of my big challenges has always been hosting. You basically have two options: Host your clients independently on their respective shared hosting plans all over the web or host them on your own server. If you choose to host them on your own server you again have two options: Host them as separate WordPress installs or host them all under a WordPress Network (previously WordPress MU). By far the best option from a content management and administration point of view is the WordPress Networks option. But it came with some pretty brutal downsides: When hosting multiple sites under a WordPress Network you are basically calling one set of core files and one database from many sites at the same time. And though this is unproblematic if each of the sites get a couple of hundred visits a day it becomes a huge problem if you have say ten sites that each pull 10,000 visits an hour. Why? Because that amounts to 100,000 calls to the same core files and the same database. That kind of traffic requires a robust server and a big pipe.</p>
<p>The solution to this problem has been to host such networks on unreasonably large and powerful servers. You basically scale for the worst case scenario and pay for a lot of down time in between. An inefficient solution, and also a cumbersome one as these setups in most cases require constant server maintenance and upkeep. Not to mention the enormous headache of adding additional drives and servers should upscaling be necessary.</p>
<p>This is what the cloud was built for: Dynamic scaleability both in terms of bandwith, capacity and processing power. So the best solution for WordPress Networks must surely lie in the cloud somewhere.</p>
<p>There&#8217;s just one problem: The cloud is complicated. And that&#8217;s where Windows Azure comes in &#8211; at least it did for me.</p>
<h2>I&#8217;m not a gardener</h2>
<p>Though I consider myself proficient at web development and people have referred to me as a &#8220;WordPress Adept&#8221; I am by no means a server expert. Quite the contrary. I have only a superficial understanding of servers and server maintenance, and I have little interest in expanding my knowledge in this field. So though a cloud server would provide me with a garden in the cloud I have little interest in becoming a gardener. I just want it to work. And that&#8217;s what Windows Azure offers: A maintained garden where I could deploy my applications.</p>
<p>The problem of course was that Windows Azure runs a .NET framework and a SQL server, not the PHP framework and MySQL server required by WordPress runs on. What was needed was some sort of symbiosis. Which is what we&#8217;ve been working on for the last 6 months.</p>
<h2>Make it Native</h2>
<p>Previous attempts had been made to make WordPress run on Azure, and they did work, at least for short periods of time. The problem was that they created pseudo states within the Azure framework where the PHP application could run, but these pseudo states were not stable. What was needed was a way of making WordPress into a native Azure application. That way it would be persistent, properly scaleable, and could be managed like any other Azure application. But this had to be done without touching the core files within WordPress, otherwise future updates would become a nightmare and that would defeat the purpose of doing this in the first place.</p>
<p>The solution was to create a set of adjoining files that served as bridges or translators between WordPress and the foreign Azure environment. That way the administrator could swap out and upgrade core files within WordPress without breaking anything and also change the configurations of the application through the normal Azure interface. And after a lot of experimentation and tweaking it worked.</p>
<h2>Domains for everyone</h2>
<p>So now we had a persistent, upgradable installation of WordPress running in Network mode on Azure. The last hurdle, the one that would prove to me most challenging, was to achieve seamless domain remapping for the different network sites. Let me explain:</p>
<p>A WordPress Network can be set up in two ways: Sub-sites or Sub-directories. The former produces site URIs such as newsite.pinkandyellow.com while the latter produces URIs like pinkandyellow.com/newsite. The obvious problem with both is that they use the pinkandyellow.com domain as the root. Which won&#8217;t work if you intend to host other sites or client sites under your network.</p>
<p>Domain remapping allows you to point these sub-sites or sub-directories to a different domain, so instead of newsite.pinkandyellow.com you&#8217;d get newsite.com. This requires a WordPress plugin (of which there are several) because the remapping has to be done based on the core URL. I could go on ad nauseum about how this works but suffice it to say it only works with one of these plugins. Problem is none of these plugins worked with SQL servers. Instead they produced bizarre errors and messed everything up quite badly. For a long time. Until the lead developer Satish found a solution.</p>
<h2>Your own personal garden in the blue cloud</h2>
<p>The end result of all this is a simple solution that allows you to deploy WordPress Networks on Windows Azure as a native application. By doing this you can take advantage of every aspect of the cloud including scaleability, persistency, CDNs and redundancy. But most importantly you will no longer be paying for processing power and bandwidth you are not using. Because Azure is a scaleable environment your solution will breathe with traffic, expanding and contracting as visitor numbers go up and down. As a result your costs will be a true representation of actual use, not a worst case scenario approach.</p>
<p>There are other great benefits to this solution including the ability to remote desktop into the application itself for beta testing and quick resets should something go wrong. In fact there are more possibilities here than I am able to wrap my mind around and as we move forward with the project countless more will undoubtedly take shape.</p>
<p>For now the only thing that matters is that you can set up and deploy your own installation right now and give this new solution a spin for yourself.</p>
<p>In the coming months I&#8217;ll be posting a series of tutorials and articles on my own experiences running WordPress on Azure. The first one on <a href="http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/" title="WordPress on Windows Azure: Single-Site Deployment">how to create a single site installation</a> went live a couple of weeks ago and will be updated as the deployment solution matures. To see a live example of WordPress running on Windows Azure you can head on over to <a href="http://photopivot.com" title="PhotoPivot.com - a digital lightboard for professional photographers" target="_blank">PhotoPivot.com</a> which currently runs on four extra small instances.</p>
<p>&nbsp;</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress/wordpress-on-windows-azure-a-bit-of-history/' addthis:title='WordPress on Windows Azure &#8211; a bit of history' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/wordpress-on-windows-azure-a-bit-of-history/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to remove WP Geo plugin from specific pages</title>
		<link>http://www.designisphilosophy.com/tutorials/how-to-remove-wp-geo-plugin-from-specific-pages/</link>
		<comments>http://www.designisphilosophy.com/tutorials/how-to-remove-wp-geo-plugin-from-specific-pages/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:17:45 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp geo]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1692</guid>
		<description><![CDATA[I ran a cross a rather interesting situation this week while working on the Vi Er Der Du Er site. The site uses the WP Geo plugin extensively on both pages, and posts, and custom post types but I needed &#8230; <a href="http://www.designisphilosophy.com/tutorials/how-to-remove-wp-geo-plugin-from-specific-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I ran a cross a rather interesting situation this week while working on the <a href="http://www.vierderduer.no" title="Vi Er Der Du Er" target="_blank">Vi Er Der Du Er</a> site. The site uses the <a href=" http://wordpress.org/extend/plugins/wp-geo/" title="WP Geo" target="_blank">WP Geo plugin</a> extensively on both pages, and posts, and custom post types but I needed to deactivate it for one particular page because I was embedding a different custom Google Map. Not surprisingly the scripts calling my custom map were conflicting with the scripts calling WP Geo and as a result the map on the page in question didn&#8217;t work.</p>
<p>At first I thought it was a matter of removing the actions that called the plugin itself. I&#8217;ve done this in the past and it works for some plugins. I also found a <a href="http://snipplr.com/view/50417/" title="Snippet" target="_blank">code snippet here</a> that seemed to show it working. That unfortunately was not the case. So I had to keep digging. Then I found this excellent article <a href="http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles" title="How to disable scripts and styles in WordPress" target="_blank">How to disable scripts and styles by Justin Tadlock</a> that explained it all: I needed to de-register the scripts, not simply remove the function. </p>
<p>After digging through the plugin code I found the script calls and ended up with this code snippet in my functions.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// remove WP Geo JS/CSS from the nybank page</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'vierderduer_deregister_javascript'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">100</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> vierderduer_deregister_javascript<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_page_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page-nybank.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'googe_jsapi'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'jquery'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'googlemaps'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wpgeo'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wpgeotooltip'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wp_deregister_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wpgeo-admin-post'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>As you can see I made the function conditional so it only kicks in when a specific page template is used. You can swap out that condition for any other condition for the same result. Bottom line is it works and now WP Geo works on every page, post and post type except pages that use the page-nybank.php template file. </p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/how-to-remove-wp-geo-plugin-from-specific-pages/' addthis:title='How to remove WP Geo plugin from specific pages' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/how-to-remove-wp-geo-plugin-from-specific-pages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress on Windows Azure: Single-Site Deployment</title>
		<link>http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/</link>
		<comments>http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 16:00:42 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress on Azure]]></category>
		<category><![CDATA[azure]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1510</guid>
		<description><![CDATA[UPDATE November 2, 2011: The WordPress on Azure scaffolder has been updated and a new and easier process has been introduced. In response this tutorial has been rewritten to reflect the new methods. In this step-by-step tutorial I&#8217;ll take you &#8230; <a href="http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-1642" title="WordPress on Windows Azure" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/wordpressandazure.jpg" alt="WordPress on Windows Azure" width="965" height="312" /></p>
<p><strong>UPDATE November 2, 2011: The WordPress on Azure scaffolder has been updated and a new and easier process has been introduced. In response this tutorial has been rewritten to reflect the new methods.</strong></p>
<p>In this step-by-step tutorial I&#8217;ll take you through the process of publishing a single-site deployment of WordPress on Windows Azure. By &#8220;single-site deployment&#8221; I mean that you&#8217;ll be using WordPress as one single site. In contrast a Network deployment refers to a situation in which you&#8217;ll set up WordPress and then run multiple sites under it in a network.</p>
<p>A step-by-step tutorial on how to deploy WordPress Networks on Windows Azure will be posted in the near future.</p>
<h2>What you&#8217;ll need</h2>
<ul>
<li>Windows Azure account (<a title="Windows Azure free trial" href="http://www.microsoft.com/windowsazure/free-trial/" target="_blank">get a free trial here</a>)</li>
<li><a title="Windows Azure SDK" href="http://www.microsoft.com/windowsazure/sdk/" target="_blank">Windows Azure SDK</a> (total pain to install so I suggest you use <a title="Web Platform Installer" href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Web Platform Installer</a>)</li>
<li><a title="FileSystemDurabilityPlugin at Github" href="https://github.com/Interop-Bridges/Windows-Azure-File-System-Durability-Plugin/downloads" target="_blank">FileSystemDurabilityPlugin</a></li>
<li><a title="Windows Azure SDK for PHP" href="http://phpazure.codeplex.com/SourceControl/changeset/changes/64152" target="_blank">Windows Azure SDK for PHP</a></li>
<li><a title="PHP for Windows" href="http://windows.php.net/download/" target="_blank">PHP</a></li>
<li><a title="Windows Azure scaffolder for WordPress" href="https://github.com/Interop-Bridges/Windows-Azure-PHP-Scaffolders/tree/master/WordPress" target="_blank">WordPress on Windows Azure scaffolder tool</a></li>
<li>Optional: The plugin(s) you want to use</li>
<li>Optional: The theme(s) you want to use</li>
</ul>
<p>The two last points are optional, but it&#8217;s always a good idea to install WordPress with the plugins and theme(s) you want to use right off the bat. It saves you a bit of time later on.</p>
<p><em>Note that the following assumes you have a Windows Azure subscription. If not, go to the Windows Azure website and <a title="Windows Azure free trial" href="http://www.microsoft.com/windowsazure/free-trial/" target="_blank">get a free trial</a>.</em></p>
<h2>1. Setting up Azure</h2>
<p>The first step in deploying WordPress on Windows Azure is to set up the necessary elements in the Windows Azure environment. This is all done through the <a title="Windows Azure Management Portal" href="http://windows.azure.com" target="_blank">Windows Azure Management Portal</a> found at <a title="Windows Azure Management Portal" href="http://windows.azure.com" target="_blank">http://windows.azure.com</a>. For the deployment you&#8217;ll need a new Hosted Service, dedicated Blob storage and a database.</p>
<p><span class="Apple-style-span" style="color: #000000; font-size: 17px; line-height: 25px;">1a. Create a new Hosted Service</span></p>
<p><img class="alignright size-full wp-image-1511" title="New Hosted Service" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/hosted_service.jpg" alt="New Hosted Service" width="321" height="173" /></p>
<p>Your WordPress deployment will live in a Hosted Service on Windows Azure. You can have multiple Hosted Services under one account. To set up a new Hosted Service log into the Windows Azure Management Portal and click the New Hosted Service button in the top left corner.</p>
<p>This opens the New Hosted Service dialog where you can define the different parameters of the hosted service as seen below:</p>
<p><img class="aligncenter size-full wp-image-1512" title="New Hosted Service Dialog" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/hostedservicedialog.png" alt="New Hosted Service Dialog" width="545" height="643" /></p>
<p>Off the top you select what subscription you want the new Hosted Service to live under.</p>
<p>Next give it a name so you know what it&#8217;s about and enter a dedicated URL prefix for your application.</p>
<p><em>By default all Windows Azure applications have a URL that looks like http://something.cloudapp.net. You can change this by forwarding one of your own domains to this address. More on that later.</em></p>
<p>Under Choose a region or affinity group you define in what general geographic area the application will be used. Pick the region or affinity group that is closest to your users.</p>
<p>When setting up a new Hosted Service you can deploy an application immediately. But since we have yet to build a deployment, check Do not deploy and click OK.</p>
<p>Windows Azure now runs a process and when it is completed you should see your new Hosted Service on the list as seen below.</p>
<p><img class="aligncenter size-full wp-image-1513" title="New Hosted Service complete" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/hostedservice.png" alt="New Hosted Service complete" width="485" height="106" /></p>
<h3>1b. Create a Storage Account (Blob storage)</h3>
<p><img class="alignright size-full wp-image-1515" title="New Storage Account" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/storage.png" alt="New Storage Account" width="321" height="173" />We&#8217;ll be using a Blob Storage Account to host all the uploaded content as well as the plugins and themes so that if and when your Windows Azure deployment reboots or reimages you don&#8217;t loose all this content. To create a Storage Account click on the New Storage Account button in the top left corner.</p>
<p>This opens the Create New Storage Account dialog as seen below:</p>
<p><img class="aligncenter size-full wp-image-1516" title="Create New Storage Account dialog" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/newstorage.png" alt="Create New Storage Account dialog" width="545" height="308" />Again pick the subscription you want to host the storage under, enter a URL prefix and set the region or affinity group. Make sure to place the Storage Account in the same region or affinity group as the Hosted Service.</p>
<p>Windows Azure runs a process and when it is completed you should see your new Storage account on the list as seen below.</p>
<p><img class="aligncenter size-full wp-image-1517" title="Storage Account created" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/storagecreated.png" alt="Storage Account created" width="545" height="90" /></p>
<h3>1c. Create a Database</h3>
<p>The final step in the Windows Azure setup process is to create a database. This is where all the actual content of the WordPress site will live. This is a two step process: First you set up a new Database Server and then you set up a new database within it.</p>
<p><img class="alignright size-full wp-image-1518" title="Create New Database Server" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/createserver.png" alt="Create New Database Server" width="85" height="76" /></p>
<p>To create the new Database Server click the Database button on the lower left and click the huge Create New SQL Windows Azure Server button under Getting Started. Alternatively you can select the correct subscription and then click the Create button on the top toolbar. This opens the Create Server dialog. This is again a multi-step process.</p>
<p>First select the region (again, pick the same region you chose for the Hosted Service and Storage).</p>
<p><img class="aligncenter size-full wp-image-1519" title="Create New Server step 1" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/server1.png" alt="Create New Server step 1" width="467" height="400" /></p>
<p>On the next screen set the username and password for the server. This is the info you&#8217;ll use to interact with the databases on the server so make sure you have a copy of it somewhere. You can edit it later but it&#8217;s a big pain.</p>
<p><img class="aligncenter size-full wp-image-1520" title="Create New Database Server step 2" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/server2.png" alt="Create New Database Server step 2" width="467" height="400" /></p>
<p>The next step is interesting. You can assign custom IP addresses that are allowed to access your database directly. That&#8217;s not necessary in our case, but it could be in the future. For now just check the Allow other Windows Azure services to access this server box so WordPress can read and write to to the database. This will add a new rule with the IP range 0.0.0.0.</p>
<p><img class="aligncenter size-full wp-image-1521" title="Create New Database Server step 3" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/server3.png" alt="Create New Database Server step 3" width="467" height="400" /></p>
<p>When you click Finish, Windows Azure will create the new database server. When it&#8217;s done it will appear with a weird computer generated name on your server list as below.</p>
<p><img class="aligncenter size-full wp-image-1522" title="Create New Database Server step 4" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/server4.png" alt="Create New Database Server step 4" width="637" height="51" /></p>
<p><img class="alignright size-full wp-image-1524" title="Create New Database" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/createdatabase.png" alt="Create New Database" width="85" height="76" />With the database server set up you can now create a database for WordPress. To do this select the new database server and click the Create Database button on the top menu. This opens the Create Database dialog seen below.</p>
<p><img class="aligncenter size-full wp-image-1525" title="Create Database dialog" src="http://www.designisphilosophy.com/wp-content/uploads/2011/07/createdb.png" alt="Create Database dialog" width="441" height="243" /></p>
<p>In the dialog give the database a name (this is the name you&#8217;ll call from the WordPress config file, define the type (edition) of database you want (the options are Web and Business of which I use Web) and set the maximum size. If you&#8217;re running a single install WordPress site I&#8217;d be flabbergasted if you ever managed to get the database up to 1GB so stick with that.</p>
<p>Click OK and Windows Azure creates the database. You&#8217;ll notice that there are two databases in the server, one called Master and the one you created. This is as it should be. You can manage, drop and mess with the database you created all you want but you should leave Master alone.</p>
<h2>2. Preparing your computer for the build</h2>
<p>Before creating your WordPress on Windows Azure deployment package you need to install the <a title="Setup the Windows Azure Development Environment automatically with the Microsoft Web Platform Installer" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-development-environment-automatically-with-the-microsoft-web-platform-installer" target="_blank">Windows Azure SDK</a>, the <a title="Download the FileSystemDurabilityPlugin from Github" href="https://github.com/Interop-Bridges/Windows-Azure-File-System-Durability-Plugin/downloads" target="_blank">File System Durability Plugin</a> and the <a title="Windows Azure SDK for PHP" href="http://phpazure.codeplex.com/SourceControl/changeset/changes/64152" target="_blank">Windows Azure SDK for PHP</a>. The Windows Azure SDK is necessary for your computer to be able to build an Windows Azure deployment package. The File System Durability Plugin does exactly what it says &#8211; ensures file system durability. This is necessary because in Windows Azure you can spin up and down several instances of the same site and we have to make sure the instances are identical all the time. The Windows Azure SDK for PHP contains the functions necessary to build custom Windows Azure deployments that depend on PHP.</p>
<p>The easiest way to install the Windows Azure SDK is to download <a title="Web Platform Installer" href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Web Platform Installer</a>, search for &#8220;Azure SDK&#8221; and install it using the tool. Web Platform Installer will do all the heavy lifting and configurations for you in one clean sweep. If you really want to you can also install the <a title="Windows Azure SDK" href="http://www.microsoft.com/windowsazure/sdk/" target="_blank">Windows Azure SDK</a> manually but I&#8217;m going to warn you up front that it&#8217;s a pain unless you are very familiar with IIS and other Windows obscura.</p>
<p>To install the File System Durability Plugin <a title="Download the FileSystemDurabilityPlugin from Github" href="https://github.com/Interop-Bridges/Windows-Azure-File-System-Durability-Plugin/downloads" target="_blank">download the zip file</a> from Github and extract it into the Windows Azure SDK plugins folder found at:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">C:\Program Files\Windows Azure SDK\v1.x\bin\plugins</pre></div></div>

<p>Finally to install <a title="Windows Azure SDK for PHP" href="http://phpazure.codeplex.com/SourceControl/changeset/changes/64152" target="_blank">Windows Azure SDK for PHP</a> simply download it and place the contents of the <em>trunk</em> folder somewhere on your computer. I created a folder called &#8220;Windows-Azure-SDK-for-PHP&#8221; in my Program Files folder for this. For what we are doing the SDK for PHP requires no installation, it just has to live on your computer in a place you can remember. If you want it to be a permanent feature on your computer you can <a title="Install Windows Azure SDK for PHP" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-sdk-for-php" target="_blank">follow the instructions at this site</a> for a more advanced install.</p>
<h2>3. Creating the WordPress on Windows Azure scaffolding</h2>
<p><em>The following assumes you have already installed <a title="Windows Azure SDK" href="http://www.microsoft.com/windowsazure/sdk/" target="_blank">Windows Azure SDK</a>, the FileSystemDurabilityPlugin, Windows Azure SDK for PHP and PHP.</em></p>
<p>With Windows Azure set up it&#8217;s time to create the WordPress deployment package. This is done using a &#8220;scaffolding&#8221; tool created specifically for this purpose. The tool is baked into the <a title="Windows Azure SDK for PHP" href="http://phpazure.codeplex.com/SourceControl/changeset/changes/64152" target="_blank">Windows Azure SDK for PHP</a>. The basic idea of the scaffolding tool is that it builds the framework in which we will build and configure the final deployment package. Once the scaffolding is created we can configure and add content such as plugins and themes to the WordPress core before deploying it.</p>
<p>To make this process as easy as possible the Microsoft Interoperability Team has created a complete solution for us, available from <a title="WordPress Windows Azure scaffolder on Github" href="https://github.com/Interop-Bridges/Windows-Azure-PHP-Scaffolders/tree/master/WordPress" target="_blank">Github</a>. Download the entire package where you want to do the setup for your deployment and let&#8217;s get started.</p>
<p>The actual building of the scaffolder will be done in Command Line (Start -&gt; CMD) in Administrator mode. You can start it from the Start Menu (remember to right-click and select Run as Administrator).</p>
<p>Before running the scaffolder command you need to include the Windows Azure SDK for PHP in the system environment. This can be done by <a title="Setup the Windows Azure SDK for PHP" href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-sdk-for-php" target="_blank">tweaking your system settings</a>, but if you want a quick and easy way that leaves your system settings alone you can just configure it for the current open command line window using this command:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #b1b100; font-weight: bold;">SET</span> PATH=<span style="color: #33cc33;">%</span><span style="color: #448888;">PATH</span><span style="color: #33cc33;">%</span>;c:\PHP;C:\Program Files\Windows Azure SDK <span style="color: #00b100; font-weight: bold;">for</span> PHP\bin</pre></div></div>

<p><em>(The above assumes PHP is installed in the PHP folder on C: drive and the Windows Azure SDK for PHP is installed in the Windows Azure SDK for PHP folder under Program Files. Your command may be different depending on where you installed PHP and Windows Azure SDK for PHP.)</em></p>
<p>With the system settings changed it&#8217;s time to run the scaffolder. You can do this manually or you can use the convenient new build.bat batch file that will run the entire process for you. In command line type:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">build.bat</pre></div></div>

<p>If you&#8217;ve kept all your ducks in a row up until this point the scaffolder will now run and you&#8217;ll see a bunch of prompts in the command line window. The scaffolder sets up the entire environment you need to get WordPress to run on Windows Azure, downloads the latest version of WordPress automatically and adds a couple of very important WordPress plugins to boot. Pretty nifty.</p>
<p>When the command completes you&#8217;ll have a new folder called &#8220;build&#8221; in the same folder where build.bat was located. The build folder in turn contains three files: ServiceConfiguration.cscfg, WordPress.cspkg and WordPress.phar in addition to a folder called WordPress.</p>
<h2>4. Configuring the WordPress for deployment</h2>
<p>With the scaffolding built it&#8217;s time to configure WordPress. If you&#8217;ve ever worked published a WordPress site before you know that you need to plug in database access info and other data in the wp-config.php file before deployment for the site to hook onto the database. In the case of WordPress on Windows Azure however, that information is placed in an Windows Azure configuration file and the wp-config.php file queries this configuration file for the details. This allows you to change the configuration of the WordPress installation on the fly through the Windows Azure deployment configuration panel rather than having to redeploy every time you want to change something. The file in question is found in the build folder and is called ServiceConfiguration.cscfg. Open ServiceConfiguration.cscfg in a text editor and make the following changes as outlined below:</p>
<h3>Database info</h3>
<p><img class="aligncenter size-full wp-image-1628" title="Database setup" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/dbsetup.jpg" alt="Database setup" width="685" height="77" /></p>
<p><strong>DB_NAME</strong> is the name you set for the database, in my case &#8220;PhotoPivotDB&#8221;</p>
<p><strong>DB_USER</strong> is your Windows Azure username combined with an @ and the name of the database server as assigned by Windows Azure. The full user name looks like this: &#8220;mor10@k3b1ogbnc7&#8243;</p>
<p><strong>DB_PASSWORD</strong> is the password you defined when setting up the server.</p>
<p><strong>DB_HOST</strong> is the host name of the server combined with .database.windows.net, so for example k3b1ogbnc7.database.core.windows.net</p>
<h3>Security keys</h3>
<p>With the new build.bat file the security keys are automatically generated so you no longer have to worry about them unless you want to add more complicated encryption.</p>
<h3>FileSystemDurabilityPlugin settings</h3>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2011/11/systemdurability.png"><img class="aligncenter size-medium wp-image-1703" title="File System Durability Plugin" src="http://www.designisphilosophy.com/wp-content/uploads/2011/11/systemdurability-506x62.png" alt="File System Durability Plugin" width="506" height="62" /></a></p>
<p>This section relates to the FileSystemDurabilityPlugin. Here you provide the access info to the Blob storage you set up earlier:</p>
<p><strong>StorageAccountName</strong> is the name you gave your storage, in my case ppwpstorage</p>
<p><strong>StorageAccountPrimaryKey</strong> you get by going to the Windows Azure portal, clicking Hosted Services, Storage Accounts &amp; CDN, selecting your storage and clicking the Primary Access Key button on the top right hand corner:</p>
<p><img class="aligncenter size-full wp-image-1609" title="Primary Access Key" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/accesskey.jpg" alt="Primary Access Key" width="214" height="117" />This opens a dialog from which you can copy the access key. It ends with two equal signs (==)</p>
<p>Leave everything else as it is.</p>
<h2>5. Create the Deployment Package</h2>
<p>The core setup is now complete and we are ready to create the deployment package. If you want to add any custom plugins or themes to your deployment, this is the time to do so. You find the plugins and themes folders under the \build\WordPress\WebRole\wp-content\ folder where you can add them by simply dropping them in. This is also where you add new or changed files when you are going to redeploy.</p>
<p>To ensure that WordPress can send administrator emails I recommend you download and add the <a title="WP Mail SMTP plugin" href="http://wordpress.org/extend/plugins/wp-mail-smtp/" target="_blank">WP Mail SMTP plugin</a>. As Windows Azure does not have a native email server you need to use an external SMTP server to handle WordPress&#8217; emails. This is further covered at the end of the article but since you&#8217;ll want the mail function to work you will save time by adding the plugin now so it&#8217;s part of your deployment package.</p>
<p>Creating the package is the final step before deploying to Windows Azure. Like with the scaffolder, the packager is run in comman line. First, navigate to the build folder where you find the WordPress.phar file. Then run the as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">package create -in=&quot;.\WordPress&quot; -out=&quot;.\package&quot; -dev=false</pre></div></div>

<p>The process runs and you should end up with a new folder called package with two files: WordPress.cspkg (named after the export folder) and ServiceConfiguration.cscfg.</p>
<h2>6. Deploying the Package</h2>
<p>To deploy the package log in to the <a title="Windows Azure Portal" href="http://windows.azure.com" target="_blank">Windows Azure Portal</a>, go to Hosted Services, Storage &amp; CDN, click Hosted Services and select the hosted service you created earlier.</p>
<p>Next click the New Production Deployment button in the upper left corner. This opens the Create a new Deployment dialog:</p>
<p><img class="aligncenter size-full wp-image-1632" title="New deployment" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/newpackage.jpg" alt="New deployment" width="553" height="396" />Give your deployment a name and point the Package location to your WordPress.cspkg file and Configuration file to ServiceConfiguration.cscfg, both in the package folder.</p>
<p>Click OK and if everything is correct you&#8217;ll get a warning like the one below. Click OK and the package will be uploaded and deployed. Because the build file will be at least 15mb in size this may take a bit of time.</p>
<p><img class="aligncenter size-full wp-image-1613" title="warning" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/warning.jpg" alt="warning" width="558" height="394" />Once the package is uploaded you have to wait for Windows Azure to do its thing. This can take quite a long time (I&#8217;ve seen it take over an hour!) You just have to be patient and wait for it to do its thing.</p>
<h2>7. Setting up WordPress on Windows Azure</h2>
<p>If everything went as planned you should see the Deployment, Role and Instance of your deployment change to Ready. If so you can click on the deployment and you&#8217;ll get the DNS name you set in step 1a (http://something.cloudapp.net). Visit this address and you&#8217;ll get the standard WordPress setup screen.</p>
<p>Here you fill out all the standard stuff like Site title, username, password and an email address. Before clicking Install WordPress, make sure you remember your username and password! As Windows Azure doesn&#8217;t have an email server WordPress will not send you an email with your username and password nor will it do so if you click the &#8220;I forgot my password button&#8221;, so be careful.</p>
<p>After hitting Install WordPress the application is installed as normal and you get to the login screen. From here we have to do a couple of extra things before we&#8217;re all set to go:</p>
<h3>7a. Set up Windows Azure Storage for WordPress</h3>
<p>WordPress normally stores all uploads in the wp-content/uploads folder and this works fine on a normal server. But Windows Azure is a virtual server environment so things don&#8217;t work the same way. This is especially true when it comes to uploads. Because your WordPress instance (or instances) on Windows Azure live on a virtual server that can be reset and re-imaged, the WordPress on Windows Azure solution has to create synced copies of the wp-content folder in Blob storage so that all instances are identical and resets are not destructive. That means if you have a ton of images or other files on your site, these will be constantly passed back and forth between your instances and Blob, and that will become costly.</p>
<p>To get around the problem the WordPress.phar file ships with an extra plugin called Windows Azure Storage for WordPress. This plugin allows you to use Blob storage to save media in your installation.</p>
<p><em>Before activating the plugin you need to assign a container in your Blob storage for your uploads. The easiest way to do this is to use a tool like <a title="ClodXplorer" href="http://clumsyleaf.com/products/cloudxplorer" target="_blank">CloudXplorer</a> and set it up manually.</em></p>
<p>To activate go to Plugins and activate Windows Azure Storage for WordPress.</p>
<p>Then go to Settings and select Windows Azure. This takes you to the configuration page for the Windows Azure Storage for WordPress plugin.</p>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2011/10/settings1.jpg"><img class="aligncenter size-full wp-image-1636" title="WordPress Azure storage plugin setup" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/settings1.jpg" alt="WordPress Azure storage plugin setup" width="564" height="205" /></a></p>
<p>Here you need to plug in the storage account name and the access key for the storage account. I use the same storage as for WordPress itself so I just copy the info out of my ServiceConfiguration.cscfg file and paste it in. If you want to you can set up separate storage as well but it seems excessive.</p>
<p>If you want to you can define an alternate CNAME for your storage (by default the domain for your Blob storage is http://YourAccountName.blob.core.windows.net/) and even set up proxy server info. I&#8217;ll leave that for you to decide.</p>
<p>Lastly remember to check the Use Windows Azure Storage for default upload box.</p>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2011/10/useasstorage.jpg"><img class="aligncenter size-full wp-image-1624" title="useasstorage" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/useasstorage.jpg" alt="" width="443" height="67" /></a></p>
<p>With everything set click Save changes and the plugin will connect to your storage.</p>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2011/10/container.jpg"><img class="aligncenter size-full wp-image-1623" title="container" src="http://www.designisphilosophy.com/wp-content/uploads/2011/10/container.jpg" alt="" width="564" height="205" /></a></p>
<p>At this point the Default Storage Container filed will be populated with whatever storage containers are available in Blob storage. Pick the container you set up for your uploads using CloudXplorer and click Save changes again.</p>
<p>Now you should be ready to go. Just to make sure, go to Media, upload an image and make sure it works and that the URL points to Blob storage.</p>
<h3>7b. Set up an external SMTP server</h3>
<p>The final compulsory step in setting up WordPress on Windows Azure is to set up an alternate SMTP server for the application so it can send emails to you and others. This is important because WordPress uses emails to communicate with you about things you need to know such as new user registrations, new comments and most importantly how to retrieve your username and password when you forget.</p>
<p>Setting up an SMTP server can be done using any one of a number of plugins. We use the <a title="WP Mail SMTP plugin" href="http://wordpress.org/extend/plugins/wp-mail-smtp/" target="_blank">WP Mail SMTP plugin</a> by <a title="Callum MacDonald" href="http://www.callum-macdonald.com/code/wp-mail-smtp/" target="_blank">Callum MacDonald</a> on <a title="PhotoPivot.com - a digital lightboard for professional photographers" href="http://photopivot.com" target="_blank">PhotoPivot.com</a> and it works splendidly. The setup of this plugin is self-explanatory and should need no further elaboration except to say you can use any number of different free SMTP servers to do so including GMail, Hotmail and others.</p>
<h2>8. Extra Credit: Domain redirect</h2>
<p>Now you have a fully functional WordPress site running on Azure on the domain name http://yourchosenname.cloudapp.net. That may not be what you had in mind. Fortunately redirecting a domain to Windows Azure is very easy. There are two steps involved:</p>
<ol>
<li>Use a CNAME redirect to point your existing domain to the Windows Azure domain (so www.yourdomain.com points to yourchosenname.cloudapp.net)</li>
<li>In WordPress go to Settings -&gt; General and change WordPress address (URL) and Site address (URL) to your new domain name.</li>
</ol>
<p>These have to be done in order and you should not change the WordPress settings until your domain fully redirects to WordPress, otherwise you won&#8217;t be able to visit your site.</p>
<h2>Appendix: Caveats</h2>
<h3>Plugin support</h3>
<p>Though running WordPress on Windows Azure is cool, there are some drawbacks, the most important of which is that not everything works as expected. WordPress itself will run fine, but many plugins cause weird problems or don&#8217;t work at all. This is especially true for a lot of form plugins. The reason for this is that WordPress on Azure uses SQL Azure even though WordPress is meant to run on MySQL. Needless to say this causes some rather bizarre problems not experienced elsewhere. That said this is a minor concern and one that can be resolved with some clever coding</p>
<h3>Service resets</h3>
<p>Due to the nature of Windows Azure, the system will sometimes reset. There is no warning when this happens and you don&#8217;t know how long it&#8217;s going to last. The way around this is to create several instances of your site. That way when one goes down the other one stays up.</p>
<h3>Bleeding edge means weird problems</h3>
<p>Running WordPress on Windows Azure is an interesting experience. Having created hundreds of WordPress sites on many different servers I can tell you I&#8217;ve experienced things on Windows Azure I&#8217;ve never seen before, and a lot of it I can&#8217;t explain. However most of these issues have been worked out and what we have now is a stable and solid release. Even so I must warn that by doing this you are entering into the world of extreme bleeding edge scenarios so expect the unexpected!</p>
<h2>Good luck and report back!</h2>
<p>Now you have the complete algorithm to get WordPress up and running on Windows Azure. The only thing left is to try it for yourself. And once you&#8217;re up, report back in the comments below and tell the world how it went, what happened and if you ran into any weirdness along the way. I&#8217;d love to hear from you and see what you&#8217;re doing so don&#8217;t be a stranger! You may also want to check out the <a title="Github forums for the PHP on Windows Azure scaffolding tool" href="https://github.com/Interop-Bridges/Windows-Azure-PHP-Scaffolders/issues" target="_blank">Github forums for the scaffolding tool</a> to see what other people are doing with this solution.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/' addthis:title='WordPress on Windows Azure: Single-Site Deployment' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/wordpress-on-azure-single-site-deployment/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Custom Page Templates in TwentyTen</title>
		<link>http://www.designisphilosophy.com/tutorials/custom-page-templates-in-twentyten-theme/</link>
		<comments>http://www.designisphilosophy.com/tutorials/custom-page-templates-in-twentyten-theme/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 16:00:10 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[custom page template]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1446</guid>
		<description><![CDATA[With the release of WordPress 3.1 came a new version of the stock TwentyTen theme with some subtle changes, most importantly the move of all the loop elements in the templates (the code that runs through the database and gathers &#8230; <a href="http://www.designisphilosophy.com/tutorials/custom-page-templates-in-twentyten-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><iframe title="YouTube video player" width="554" height="344" src="http://www.youtube.com/embed/pvzx9k61X1M" frameborder="0" allowfullscreen></iframe><br />
With the release of WordPress 3.1 came a new version of the stock TwentyTen theme with some subtle changes, most importantly the move of all the loop elements in the templates (the code that runs through the database and gathers info like title, date, author, categories, content, images etc) into their own files. In the first release of TwentyTen this was restricted to just the single post view (loop in loop-single.php) but now it also extends to among other files the page tempalte (loop-page.php).</p>
<p>The problem arises when you want to create custom page templates. Previously all you needed to do was copy the page.php file and make the changes you wanted in the loop. But with the new system copying the page.php file alone won&#8217;t let you make any changes to the loop, just the overall structure (header, sidebar, footer etc). To make changes to the loop you have to either copy the loop code out of loop-page.php and into your custom page template or use a conditional statement along with the is_page_template() function in the loop-page.php file to detect that a custom page template is being used and then make the changes. The video above demonstrates both approaches.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/custom-page-templates-in-twentyten-theme/' addthis:title='Custom Page Templates in TwentyTen' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/custom-page-templates-in-twentyten-theme/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>IE9 Pinned Sites for WordPress</title>
		<link>http://www.designisphilosophy.com/tutorials/ie9-pinned-sites-for-wordpress/</link>
		<comments>http://www.designisphilosophy.com/tutorials/ie9-pinned-sites-for-wordpress/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 23:44:28 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[ie9]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1433</guid>
		<description><![CDATA[With the release of Internet Explorer 9 came a new and very cool feature that can greatly enhance the user experience for frequent visitors and also increase exposure for sites that activate it. The feature is called Pinned Sites and &#8230; <a href="http://www.designisphilosophy.com/tutorials/ie9-pinned-sites-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2011/04/pinnedsites3.jpg"><img src="http://www.designisphilosophy.com/wp-content/uploads/2011/04/pinnedsites3.jpg" alt="Design Is Philosophy pinned sites functionality" title="Design Is Philosophy pinned sites functionality" width="550" class="aligncenter size-full wp-image-1443" /></a>With the release of Internet Explorer 9 came a new and very cool feature that can greatly enhance the user experience for frequent visitors and also increase exposure for sites that activate it. The feature is called Pinned Sites and lets you turn any website or even web page into a customized pinned item on the Windows 7 toolbar.</p>
<p>What I like about this feature is that it runs of non-intrusive meta tags and JavaScript so that although it only works in IE9, it doesn&#8217;t interfere with other browsers. It becomes a value added experience for IE9 users but it doesn&#8217;t take anything away from people who do not use IE9 or don&#8217;t have Windows 7 as their operating system. Progressive enhancement I believe they call it</p>
<p>Last Saturday I did an <a title="Friends upgrade friends to IE9" href="http://www.designisphilosophy.com/events/speaking-engagements-events/friends-upgrade-friends-to-ie9/">hour long demo of this feature</a> and how to build it into a WordPress site. The example in question was this very site and now I&#8217;m going to show you how you can make  your own WordPress site pinnable too.</p>
<h2>Pinned Sites and why they matter</h2>
<p>So what is a Pinned Site in IE9? The idea is simple: You open a site in IE9, grab the tab for that site and pull it down to your Windows 7 task bar. If the site is pinnable it will dock onto the taskbar with a custom icon like you see in the grab above. When the user then clicks the icon, a custom IE9 window will open just for this site. The size and even element colour of that window can be defined by the site owner. The result is that the website becomes more like a native application on the computer and this in turn leads to increased stick time (<a title="Huffington Post gets 49% higher stick time with IE9 Pinned Sites" href="http://windowsteamblog.com/ie/b/ie/archive/2011/02/17/economics-of-the-web-ie9-users-that-pin-huffington-post-spend-49-more-time-on-site.aspx">49% for the Huffington Post</a>), more exposure and higher returning visitor rates. Whether you like IE9 or think it&#8217;s the worst thing since sushi falvoured gum the reality is site owners will benefit from this functionality. But I digress.</p>
<h2>Making your site pinnable</h2>
<p>To set up basic pinned site functionality you need a high quality favicon and access to your theme files. If you have both you&#8217;re good to go.</p>
<p>Because the pinned icons on the taskbar are larger than the regular ones I recommend using <a title="X Icon Editor" href="http://www.xiconeditor.com/">X-Icon Editor</a> (free online tool) to generate the icon and create it for all four standard sizes (64&#215;64, 32&#215;32, 24&#215;24 and 12&#215;12). I also recommend creating it from a high quality and high contrast PNG file so it looks nice regardless of the background.</p>
<p>Once  you have the favicon.ico file save it to your current theme folder so it lives alongside index.php and all the other files. Once that&#8217;s done it&#8217;s time to crack open header.php in your theme folder and get to work.</p>
<p>To get the favicon to work add the following code right before the end head tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;shortcut icon&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo get_bloginfo('template_url') ?&gt;</span></span>/favicon.ico&quot; /&gt;</pre></div></div>

<p>Assuming you placed the favicon.ico file in the root of your theme folder this will automatically add it as a favicon for all browsers, even really old ones. Note that if you already have a link with rel set to shortcut icon like this you&#8217;ll create a mess. You should only have one favicon link in your theme, but most WordPress themes including TwentyTen don&#8217;t have one so you should be fine.</p>
<p>Next, to make the site pinnable we&#8217;re going to add five meta tags directly underneath:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application-name&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Your Site Name&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-tooltip&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tooltip message&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-starturl&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.YourSite.com&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-window&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width=600;height=600&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-navbutton-color&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#colour&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>The above code is pretty self explanatory. Just swap out the content values with your own preference. The msapplication-window tag controls the size of the custom IE9 window that opens when you click the button.. The msapplication-navbutton-color tag controls the colour of the navigation buttons in the window as in the image above.</p>
<p>With the favicon code and these five meta tags included in your header your site will be pinnable. That really is all there is to it. But you can do a lot more!</p>
<h2>Adding Jump Lists</h2>
<p><img class="alignright size-full wp-image-1434" title="Pinned Sites" src="http://www.designisphilosophy.com/wp-content/uploads/2011/04/pinnedSites1.jpg" alt="Pinned Sites" width="290" height="405" />If you look at the image to the right you&#8217;ll see there are two custom links in the jump list (right-click on the icon) for my pinned site under Tasks: Code of Ethics and Mor10 on Twitter. These are generated with an additional custom meta tag as below:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-task&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name=Link Name;action-uri=http://www.YourSite.com/YourLink.html;icon-uri=http://www.YourSite.com/custom.ico&quot;</span><span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>Again it&#8217;s pretty straight forward: You just insert your own content and links in the name, action-uri and icon-uri variables and you&#8217;re good to go. I placed all my custom icons in the images folder under my theme and used a dynamic link for them. For the Twitter link my meta tag looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;msapplication-task&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name=Mor10 on Twitter;action-uri=http://www.twitter.com/mor10;icon-uri=&lt;?php echo get_bloginfo('template_url') ?&gt;</span></span>/images/twitter.ico&quot;/&gt;</pre></div></div>

<h2>Adding dynamic Custom Jump Lists displaying the latest 5 WordPress posts</h2>
<p>Adding static links is all well and good, but the Pinned Sites functionality also allows you to add custom Jump Lists. This is done through JavaScript. The basic function, which is still static, looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span>&gt;</span>
	function AddJumpList()	{
		try	{
			if (window.external.msIsSiteMode())	{
				window.external.msSiteModeCreateJumplist(&quot;Custom Jumplist Title&quot;);
&nbsp;
				window.external.msSiteModeAddJumpListItem(&quot;Title&quot;, &quot;http://www.YourSite.com/link&quot;, &quot;http://www.YourSite.com/custom.ico&quot;);
&nbsp;
				window.external.msSiteModeShowJumplist();
			}
		}
		catch (error)
		{
		}
	}
	AddJumpList();
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Unlike the meta tags before this is straight up JavaScript which means all browsers will try to run it even if they don&#8217;t support the function. For this reason I&#8217;ve added a conditional feature detection script that makes sure the browser supports msIsSiteMode before running it.</p>
<p>To add new items in the Custom Jump List you just copy and paste the window.external.msSiteModeAddJumpListItem() function and change the title, link and icon attributes.</p>
<p>But that&#8217;s just static lists. For this feature to be meaningful it needs to have dynamic lists that show the most recent posts from the site, right? For that we&#8217;re going to use some hard coded PHP and a custom WordPress loop to create the jump list items dynamically. That loop looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$featuredPosts</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$featuredPosts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;showposts=5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$featuredPosts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$featuredPosts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		window.external.msSiteModeAddJumpListItem(&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;, &quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;, &quot;http://www.YourSite.com/custom.ico&quot;);
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>As you can see it&#8217;s a simple WP_query that calls the 5 most recent posts and then uses the title and permalink attributes to populate the jumplist. Just to state the obvious: You can use any query you want to poll any content you want here. You don&#8217;t have to stick with my boring loop.</p>
<p>With this custom loop inserted the full Dynamic Custom Jump List function looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span>&gt;</span>
	function AddJumpList()	{
		try	{
			if (window.external.msIsSiteMode())	{
				window.external.msSiteModeCreateJumplist(&quot;New Posts&quot;);
&nbsp;
				<span style="color: #009900;">&lt;?php</span>
<span style="color: #009900;">					$featuredPosts <span style="color: #66cc66;">=</span> new WP_Query<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">					$featuredPosts-&gt;</span>query(&quot;showposts=5&quot;);
&nbsp;
					while ($featuredPosts-&gt;have_posts()) : $featuredPosts-&gt;the_post(); ?&gt;
						window.external.msSiteModeAddJumpListItem(&quot;<span style="color: #009900;">&lt;?php the_title<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&quot;, &quot;<span style="color: #009900;">&lt;?php the_permalink<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span>&quot;, &quot;<span style="color: #009900;">&lt;?php echo get_bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template_url'</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span>/images/news.ico&quot;);
&nbsp;
					<span style="color: #009900;">&lt;?php endwhile; ?&gt;</span>
&nbsp;
				window.external.msSiteModeShowJumplist();
			}
		}
		catch (error)
		{
		}
	}
&nbsp;
	AddJumpList();
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Assuming you have an icon named news.ico in the images folder under your current theme this code produces a dynamic custom jump list displaying the titles of your five most recent posts, each with an icon, that points directly to that post.</p>
<p>Cool? I think so. Now pin my site and add the functionality to your own!</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/ie9-pinned-sites-for-wordpress/' addthis:title='IE9 Pinned Sites for WordPress' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/ie9-pinned-sites-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jetpack &#8211; New must-have WordPress Plugin</title>
		<link>http://www.designisphilosophy.com/wordpress/jetpack-new-must-have-wordpress-plugin/</link>
		<comments>http://www.designisphilosophy.com/wordpress/jetpack-new-must-have-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 17:36:26 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1405</guid>
		<description><![CDATA[UPDATE: As of around 3pm Thursday the WordPress.com Stats plugin seems to be back up and running although it is producing some very strange stats that don&#8217;t correspond with what the stats in Jetpack produces. Weird stuff, and as far &#8230; <a href="http://www.designisphilosophy.com/wordpress/jetpack-new-must-have-wordpress-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><strong>UPDATE: </strong>As of around 3pm Thursday the WordPress.com Stats plugin seems to be back up and running although it is producing some very strange stats that don&#8217;t correspond with what the stats in Jetpack produces. Weird stuff, and as far as I can tell still no explanation from the powers that be.</em></p>
<p>Last night (March 16th) Twitter and WordPress forums exploded with people receiving error messages when trying to access their WordPress stats through the WordPress.com stats plugin. This happened to me too: When trying to access my stats I got this nice uninformative error message:</p>
<blockquote><p>Your WordPress.com account, <code>xxxxx</code> is not authorized to view the stats of this blog.</p></blockquote>
<p>I did a little digging and found out that the WordPress.com Stats plugin has been replaced by the <a title="Jetpack - WordPress.com functions for your WordPress.org site" href="http://jetpack.me" target="_blank">Jetpack plugin</a> (or rather, the WordPress.com Stats functionality has been baked into the Jetpack plugin) and a simple way of getting the stats up and running again was to simply install the plugin, activate it and link it up to my WordPress.com account.</p>
<h2>WordPress.com goodies come to self-hosted WordPress.org sites</h2>
<p>Before I start ranting let me just say that the new Jetpack plugin is what I would consider a must-have for self-hosted WordPress sites. Not only does it have the WordPress.com Stats built in but it also comes with a whole menagerie of other features that come standard with WordPress.com sites but previously had to be installed separately in self-hosted sites. These are:</p>
<ul>
<li>WordPress.com Stats</li>
<li>Twitter Widget</li>
<li>Gravatar Hovercards</li>
<li>WP.me Shortlinks</li>
<li>Sharedaddy</li>
<li>LaTeX</li>
<li>After the Deadline</li>
<li>Shortcode Embeds</li>
</ul>
<p>Some of these features including Stats and Sharedaddy are <a title="10 WordPress plugins I use all the time" href="http://www.designisphilosophy.com/wordpress/10-wordpress-plugins-i-use-all-the-time/" target="_blank">plugins I&#8217;ve already recommended</a>, and the others are pretty useful too (especially After the Deadline which is an integrated spell- and grammar check tool). To learn more about the features and what they do go to <a title="WordPress Jetpack Plugin" href="http://jetpack.me" target="_blank">Jetpack.me</a> and check them out.</p>
<p>The great thing about the Jetpack plugin is that it consolidates a bunch of features that previously required separate plugins and installs to work. And judging by the open &#8220;Coming Soon&#8221; boxes at the bottom of the plugin page I&#8217;m guessing more stuff will be added shortly. The Jetpack plugin runs off cloud services which means some of the functionality lives in the cloud and not on your computer, in other words the plugin can be updated externally to add more functionality to your site without you having to run the manual update. Which is great. Well, sort of at least.</p>
<p>Cloud computing is what we are moving towards, and for integrated services like WordPress.com Stats it makes a lot of sense. The question here is what the underlying reasoning is and where this will take us. That&#8217;s where my rant comes in.</p>
<h2>How about a little warning, eh?</h2>
<p>There are two things that irk me about this whole situation: First off, no warning or information was issued about the disabling of WordPress.com Stats which lead to (and is still leading to) a lot of panicked posts and confused people. This could easily habe been remedied with a simple post or warning saying &#8220;Oh, btw we are disabling WordPress.com Stats and supplanting it for the Jetpack plugin so if you want your stats you have to install it&#8221; and they have done this, at least in part, by adding a &#8220;We&#8217;re working on it&#8221; message to the error displayed in the old Stats window. But it still leaves me wondering what actually happened here. Well, not actually wondering. More like speculating.</p>
<p>You see, I think this is actually part of a larger plan (<strong>WARNING: The following is pure speculation on my part and may very well be complete rubbish</strong>):</p>
<p>Logging into your WordPress.com account right now you&#8217;ll notice your API key doesn&#8217;t exist any more. The only API key available is the one you can purchase from <a title="Akismet - comment moderation for WordPress" href="http://www.akismet.com" target="_blank">Akismet</a>. Yes, I said purchase. If you&#8217;ve been running Akismet on your WordPress site for a long time you may not know this but as of some time early last year Akismet went from being a free service to being a paid service. However, for those who had activated the plugin before the switch using the general WordPress.com API key Akismet still worked for free. And and even after the change you could circumvent the payment option by using your WordPress.com Stats API key as your Akismet API key and still get the same services for free. I think you see where I&#8217;m going with this.</p>
<p>From what I can tell the WordPress.com Stats plugin stopped working because the WordPress.com API key was disabled. I&#8217;m venturing a guess that this was done to force people to finally buy a proper Akismet key. Unfortunately WordPress.com Stats was an unexpected victim, which is why we haven&#8217;t heard any official word on what&#8217;s going on here yet.</p>
<p>Like I said before, <strong>this is all speculation on my part</strong> and I hope we hear some official explanation sooner rather than later, but at least it makes all the pieces fit. I have no problem with WordPress.com Stats being replaced with Jetpack nor do I have a problem with Akismet being a paid service (though I think it&#8217;s <em>way</em> too expensive), but the way this has unfolded is not very open nor transparent and needs some polishing. You can&#8217;t just kille a hugely popular plugin without telling people first.</p>
<p>My second issue with the move is that not everyone wants everything in the Jetpack. A lot of people like to keep everything separated and firewalled. I&#8217;m guessing that Automattic wants to move towards more integrated solutions like Jetpack to serve up lots of functionality in small packages. Which is great as long as it doesn&#8217;t push away the individual pieces. Right now, unless something is changed and WordPress.com Stats goes live again, you have to install Jetpack to get your stats, and that means you&#8217;ll now have multiple pluings running the same function if you have any of the other things like Sharedaddy installed. It&#8217;s a hassle because you&#8217;ll have to disable these doubles. Granted Jetpack picks up the settings from the old plugin, but it&#8217;s still not as clean as it should be.</p>
<h2>Let us in on what&#8217;s going on!</h2>
<p>The bottom line here is pretty clear: To Automattic, let us know what&#8217;s going on. If you want us to ditch WordPress.com Stats for Jetpack, just tell us. If WordPress.com Stats is coming back online, tell us that. And please explain what happened in the interim. Also, if you are disabling WordPress.com stats (and other plugins?) to be replaced by Jetpack, put a nice big warning in the plugin pages for those plugins so people know what&#8217;s going on and don&#8217;t start posting panicked messages in the forum. Transparency is key.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress/jetpack-new-must-have-wordpress-plugin/' addthis:title='Jetpack &#8211; New must-have WordPress Plugin' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/jetpack-new-must-have-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Add a Twitter-like &#8220;Published X Days Ago&#8221; timestamp to your WordPress posts</title>
		<link>http://www.designisphilosophy.com/tutorials/add-a-twitter-like-timestamp-to-your-wordpress-posts/</link>
		<comments>http://www.designisphilosophy.com/tutorials/add-a-twitter-like-timestamp-to-your-wordpress-posts/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 02:01:29 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[custom code]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1366</guid>
		<description><![CDATA[For the last couple of weeks I&#8217;ve been working on a massive WordPress project that has required a lot of interesting and unusual components that step well outsie of what is normally expected from WordPress and its plugins. Once the &#8230; <a href="http://www.designisphilosophy.com/tutorials/add-a-twitter-like-timestamp-to-your-wordpress-posts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the last couple of weeks I&#8217;ve been working on a massive WordPress project that has required a lot of interesting and unusual components that step well outsie of what is normally expected from WordPress and its plugins. Once the project is live I&#8217;ll write a longer article about all these components, but in the meantime I&#8217;m going to share some of the functions because I think you might find them useful.</p>
<h2>&#8220;Published X Days Ago&#8221;</h2>
<p>The first function I&#8217;ll feature is a small script that spits out a text telling the viewer how long ago a post was posted. I actually needed this script for a countdown so mine is a fair bit longer, but it can be used to create a Twitter-like time stamp just as easily.</p>
<p>To achieve this we&#8217;ll be using two functions, <a title="Full breakdown of the date() function" href="http://php.net/manual/en/function.date.php" target="_blank">date()</a> and <a title="Full breakdown of the get_the_time() function" href="http://codex.wordpress.org/Function_Reference/get_the_time" target="_blank">get_the_time()</a>. The former is a bona fide PHP function that grabs the current local time from the server while the latter is a WordPress function that grabs the time of publishing for the post.</p>
<p>It doesn&#8217;t take a genius to figure out how we&#8217;re going to use these two: Taking the current time and subtracting the published time will give you the time difference, in other words how long ago the post was published. The challenge is that you need to get the right time formats to actually output a rational result.</p>
<h2>Getting the right kind of time</h2>
<p>You&#8217;d think that if you want to count how many days ago a post was posted you could just grab the dates and count backwards. But that&#8217;s actually pretty hard because it relies on the counting mechanism knowing what day of the month it is and how many days each month has etc etc. A better solution is to grab a unified time value that doesn&#8217;t change in the same arbitrary way. Luckily programmers found this problem and its solution a long long time ago. It is called the the Unix Epoch and is the time, in seconds, since January 1, 1970 00:00:00 GMT). To get this value for each of our functions we simply add in the format string &#8220;U&#8221; like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// outputs the current date and time in Unix Epoch terms</span>
get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// outputs the publishing date and time in Unix Epoch terms</span></pre></div></div>

<h2>Making the time make sense</h2>
<p>Problem is this produces a weird long number like 6250458. This is the number of seconds since the article was published. We want the number of days, so we need to do some math.</p>
<p>If you have seconds and you want to make days you first have to divide them by 60 to make minutes, then divide it by 60 again to make hours and then finally divide it by 24 to make days. For 86399 out of every 86400 seconds of the day this will produce an integer (number with a comma) but we want whole numbers. So we utilize an extra function called <a href="http://php.net/manual/en/function.round.php" title="Full breakdown of the round() function" target="_blank">round()</a> that rounds out the number for us.</p>
<h2>Putting it together</h2>
<p>With that we have all the components we need to get the number of days since published. In PHP form the function looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
	<span style="color: #000088;">$days</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Published &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$days</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; days ago&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This will output the number of days since published sandwhiched between the words &#8220;Published&#8221; and &#8220;days ago&#8221;. But what about the first day, when the number is zero, or the second day when the number is one? &#8220;Published 0 days ago&#8221; and &#8220;Publised 1 days ago&#8221; looks kind of sloppy, no? Well, it&#8217;s easy to fix with some conditional statements:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
	<span style="color: #000088;">$days</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'U'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$days</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Published today&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$days</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Published yesterday&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Published&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$days</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; days ago&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>All these conditional statements do is ask &#8220;if the number of days is 0, say &#8220;Published today&#8221;, if the nuber is 1, say &#8220;Published yesterda&#8221; and for all other cases say &#8220;Published X days ago&#8221;.</p>
<p>Copy this piece of code anywhere in your theme files within the WordPress Loop and it&#8217;ll spit out a published x days ago timestamp on your posts.</p>
<p>Easy as Pi.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/add-a-twitter-like-timestamp-to-your-wordpress-posts/' addthis:title='Add a Twitter-like &#8220;Published X Days Ago&#8221; timestamp to your WordPress posts' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/add-a-twitter-like-timestamp-to-your-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordCamp:Developers &#8211; a WordPress conference for WordPress developers</title>
		<link>http://www.designisphilosophy.com/wordpress/wordcampdevelopers-a-wordpress-conference-for-wordpress-developers/</link>
		<comments>http://www.designisphilosophy.com/wordpress/wordcampdevelopers-a-wordpress-conference-for-wordpress-developers/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 17:00:14 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordCamp:Developers]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1351</guid>
		<description><![CDATA[Get your calendars out and mark this date down with a pen: Thursday May 5th, 2011. In fact, mark that whole week down. Vanessa Chu, Anny Chih and I are putting on the first ever WordCamp:Developers as part of Vancouver &#8230; <a href="http://www.designisphilosophy.com/wordpress/wordcampdevelopers-a-wordpress-conference-for-wordpress-developers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordcampdevelopers.com"><img class="aligncenter size-full wp-image-1352" title="WordCamp:Developers - the WordPress Developer Conference" src="http://www.designisphilosophy.com/wp-content/uploads/2011/02/wordcampdevelopers.jpg" alt="WordCamp:Developers - the WordPress Developer Conference" width="554" height="113" /></a>Get your calendars out and mark this date down with a pen: Thursday May 5th, 2011. In fact, mark that whole week down. <a title="Vanessa Chu" href="http://www.designfaire.com/" target="_blank">Vanessa Chu</a>, <a title="Anny Chih" href="http://annychih.com" target="_blank">Anny Chih</a> and I are putting on the first ever <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com" target="_blank">WordCamp:Developers</a> as part of Vancouver Open Source Week and the week ends with Microsoft&#8217;s two-day <a title="Make Web Not War Vancouver" href="http://webnotwar.ca/" target="_blank">Make Web Not War</a> open-source conference. All in all Vancouver is going to be the place to be in May (<a title="Northern Voice" href="http://2011.northernvoice.ca/" target="_blank">Northern Voice</a>, the two-day blogging conference is the very next week) so you might as well clear your schedule and get ready!</p>
<h2>Why a WordCamp for Developers?</h2>
<p>Vanessa and I have been running the <a title="Vancouver WordPress Meetup" href="http://www.meetup.com/Vancouver-WordPress-Meetup-Group/" target="_blank">Vancouver WordPress Meetup</a> for the last 9 months and the overwhelming response we&#8217;ve gotten is that people want to learn more about web development with WordPress as a platform. They also want to know more about related technologies, future developments and things like user experience design and information architecture.</p>
<p>So far the only WordPress focussed conferences have been regular WordCamps. But although these conferences are great for bloggers and people who work with WordPress, their focus tends to be more on blogging and basic publishing and less on hard core development and other related topics. Because WordPress has grown from a solid blogging platform to a full fledged CMS we felt it&#8217;s time we put on a conference focusing on the people who use WordPress to build stunning, functional and ground breaking websites. Thus <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank">WordCamp:Developers</a> was created.</p>
<h2>What Can I Expect From WordCamp:Developers?</h2>
<p>Like I said the focus of <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank">WordCamp:Developers</a> will be on topics that are relevant to people who work with WordPress as a development platform every day. Right now we are scouring the continent looking for the best and brightest speakers with expertise in advanced WordPress development, Information Architecture, user experience design, security, eCommerce and so on. Based on feedback and trends in the community we are also looking for speakers to focus on new technologies like HTML5 and CSS3 as well as integrated technologies like JavaScript and AJAX.</p>
<p>The goal of <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank">WordCamp:Developers</a> is to provide a platform for the advancement of WordPress as a serious Content Management System and start a discussion about how we, as web developers, can use WordPress to make the web a better, more functional and more attractive space for everyone.</p>
<p>If you are an expert in any of the fields listed above or anything else related or relevant to WordPress development or if you know someone who is, go fill out the <a title="WordCamp:Developers speaker submissions" href="http://wordcampdevelopers.com/speaker-submissions/" target="_blank">speaker submission form</a> or <a title="Contact WordCamp:Developers" href="http://wordcampdevelopers.com/contact/" target="_blank">get in touch with us</a> through the <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank"></a>website ASAP.</p>
<p><strong>The deadline for speaker submissions is </strong><strong>February 28th so get crackin!</strong></p>
<h2>Tickets, Venue and Volunteers</h2>
<p>We are in the process of rolling out ticket sales for WordCamp:Developers. We were going to release tickets this week but some very generous sponsors have just come onboard and with their contributions we are able to push down the prices and make the event more accessible so we need to crunch the numbers again to ensure we give all our attendees the most bang for their bucks.</p>
<p>We are releasing a total of 200 attendee tickets for the event. Our 12 main speakers will be added on top of that number, and if you buy a ticket and then get selected as a speaker we will put your ticket back in the general pool for someone else to pick up.</p>
<p><a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank">WordCamp:Developers</a> will be held at the <a title="Map link to SFU Harbour Centre" href="http://www.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=+Simon+Fraser+University%E2%80%8E+515+West+Hastings+Street&amp;aq=&amp;sll=49.284313,-123.111489&amp;sspn=0.001008,0.002411&amp;ie=UTF8&amp;hq=Simon+Fraser+University&amp;hnear=Simon+Fraser+University,+515+W+Hastings+St,+Vancouver,+Greater+Vancouver+Regional+District,+British+Columbia+V6B+5K3,+Canada&amp;z=14" target="_blank">SFU Harbour Centre</a> in downtown Vancouver. The event will feature two main tracks, UX (Focus on Designers) and DEV (Focus on Developers) as well as an ad-hoc (un-conference) room where attendees can pitch 20 minute talks on the day of the event. We are booking a total of 12 speakers, 6 for each of the main rooms, and ensuring that each talk will be on its own topic so attendees get the most out of the event.</p>
<p>As part of admission all attendees will be served a great lunch in a room overlooking the harbour and we&#8217;ll have coffee, snacks and other goodies throughout the day.</p>
<p>This event, like all WordCamps, is a not-for-profit volunteer based innitiative and we are looking for volunteers to help both for organization and day-of management. If you&#8217;re interested in playing a part in WordCamp:Developers <a title="Contact WordCamp:Developers" href="http://wordcampdevelopers.com/contact/" target="_blank">get in touch with us</a> through the website.</p>
<h2>Sponsorships and Swag</h2>
<p><img class="alignright" title="Make Web Not War Montreal" src="http://farm5.static.flickr.com/4045/4645673654_b37974e401_o.jpg" alt="" width="227" height="151" />As I mentioned earlier this event could not have happened without the generous support of our sponsors. We already have a couple of big companies on board (TBA) but we are still looking for more sponsors to make this event as great as it can be. On that note I have to mention the Microsoft Canada team that is putting on the open source conference <a title="Make Web Not War Vancouver" href="http://webnotwar.ca" target="_blank">Make Web Not War</a> and Vancouver Open Source Week. I spoke at Make Web Not War in Montreal last year and I can honestly say <a title="Make Web Not War Montreal - a recap" href="http://www.designisphilosophy.com/events/make-web-not-war-2010-a-recap/" target="_blank">it is one of, if not the best conference I&#8217;ve been to</a>. And the Vancouver edition, slated for May 6th and 7th, proves to be even better!</p>
<p>If you or your company is interested in being a partner please check out our <a title="Sponsor WordCamp:Developers" href="http://wordcampdevelopers.com/sponsors/" target="_blank">sponsorship page</a> for all the details.</p>
<p>Based on feedback from other events we are trying to make <a title="WordCamp:Developers - the WordPress Developer Conference" href="http://wordcampdevelopers.com/" target="_blank">WordCamp:Developers</a> as green as possible. As part of that we are being very counscious about what kind of swag we will be handing out to attendees, speakers and volunteers. To that end the focus of all our swag will be on usability. As in we will only hand out things our attendees can use and have a use for. That means if you or your company have a product, virtual or physical, that you feel would be of use to web developers, we want to talk to you. <a title="Contact WordCamp:Developers" href="http://wordcampdevelopers.com/contact/" target="_blank">Get in touch with us</a> through the website and we&#8217;ll get the conversation started.</p>
<h2>Consider This Your Personal Invitation</h2>
<p>WordCamp:Developers is a WordPress conference for developers, by developers and we put it together because we know developers like us want a place where they can talk shop. Consider this your personal invite to the conference, to attend, to speak, to sponsor, to volunteer. WordPress is an open source platform that is changing the world and we want everyone to be part of the revolution. So mark your calendars, get the word out and let&#8217;s make WordCamp:Developers and Open Source Week amazing!</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress/wordcampdevelopers-a-wordpress-conference-for-wordpress-developers/' addthis:title='WordCamp:Developers &#8211; a WordPress conference for WordPress developers' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/wordcampdevelopers-a-wordpress-conference-for-wordpress-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordCamp Victoria Presentation: 10 Theme Hacks to Improve Your Site</title>
		<link>http://www.designisphilosophy.com/tutorials/wordcamp-victoria-presentation-10-theme-hacks-to-improve-your-site/</link>
		<comments>http://www.designisphilosophy.com/tutorials/wordcamp-victoria-presentation-10-theme-hacks-to-improve-your-site/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 21:47:24 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Speaking Engagements]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordcamp]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1328</guid>
		<description><![CDATA[Above is the slide deck for my WordCamp Victoria presentation entitled &#8220;10 WordPress Theme Hacks to Improve Your Site&#8221;. Unlike my regular presentation this one is entirely slides based which means if you just read the slides, you&#8217;ll get the &#8230; <a href="http://www.designisphilosophy.com/tutorials/wordcamp-victoria-presentation-10-theme-hacks-to-improve-your-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object id="__sse6664129" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="450" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wordcampvictoria-110122121803-phpapp01&amp;stripped_title=10-wordpress-theme-hacks-to-improve-your-site&amp;userName=mor10" /><param name="name" value="__sse6664129" /><param name="allowfullscreen" value="true" /><embed id="__sse6664129" type="application/x-shockwave-flash" width="550" height="450" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wordcampvictoria-110122121803-phpapp01&amp;stripped_title=10-wordpress-theme-hacks-to-improve-your-site&amp;userName=mor10" name="__sse6664129" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
Above is the slide deck for my WordCamp Victoria presentation entitled &#8220;10 WordPress Theme Hacks to Improve Your Site&#8221;. Unlike my regular presentation this one is entirely slides based which means if you just read the slides, you&#8217;ll get the gist of it. Below are all my code examples along with links to further information, example sites and related tutorials to give you some context. Knock yourself out!</p>
<h2>Replace Site Title with a Linked Image</h2>
<p>This is my number one pet peeve. When people visit a site they intuitively expect the logo or header image to be a link back to the home page, and it should be. When it&#8217;s not they (and I) get annoyed. Making your header image link back to your home page is not hard. All you have to do is wrap the header image code in a simple anchor tag that leads back to your root URL and you&#8217;re good to go. For simplicity the code looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;lt;?php get_bloginfo( 'name' ); ?&amp;gt;&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;home&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;lt;?php echo home_url( '/' ); ?&amp;gt;&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
… the image code …
&nbsp;
<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

<p>For a more in-depth explanation check out the tutorial <a href="http://www.designisphilosophy.com/24-days-of-wordpress/day-3-twentyten-header-image-as-home-button/" title="TwentyTen Header Image as Home Button" target="_blank">Twentyten Header Image as Home Button</a>.</p>
<h2>Enable WordPress 3 Custom Menus</h3>
<p>The WordPress 3 custom menu function is built into the TwentyTen theme and most newer themes, but older themes usually just have hard-coded menus. Adding WP 3 custom menus to a theme is not hard though. It requires a function call in the functions.php file and a template tag in the template file of your choice (usually header.php and/or footer.php). Here&#8217;s that code:</p>
<p>In functions.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">register_nav_menus<span style="color: #009900;">&#40;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                <span style="color: #0000ff;">'menuName'</span> <span style="color: #339933;">=&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Menu Name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">' primary'</span> <span style="color: #339933;">=&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Primary Menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'2ndMenu'</span> <span style="color: #339933;">=&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2nd Menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Where menuName is the identifying slug for WordPress and Menu Name is the actual displayed name in WordPress Admin.</p>
<p>To display a menu you can either call it based on the slug:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
        wp_nav_menu<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                <span style="color: #0000ff;">'theme_location'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'primary'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>&#8230; or the name defined in the Menus admin area:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
        wp_nav_menu<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                 <span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Menu Name'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Menus Outside the Box</h2>
<p>Menus don&#8217;t have to be regular boring one or two word one-line elements. Because WordPress allows HTML in the Navigation Label you can add more interesting designs like we did on the <a href=http://vancouverphotomarathon.com/" title="12x12 Vancouver Photo Marathon" target="_blank">12&#215;12 Vancouver Photo Marathon</a> site. On this site we added a simple span tag around the text that displays under the menu heading and then used CSS to change how it displays. Sorry, no code examples &#8211; it&#8217;s just straight up CSS and out of context it makes no sense.</p>
<h2>WordPress 3 Custom Background Images and Colours</h2>
<p>The TwentyTen theme introduced a very cool custom background function built right into the admin interface (under Appearance -> Background). This is not a function found in TwentyTen but a core function found in WordPress. That means you can activate it in any theme. All you have to do is call it from the functions.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_custom_background<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The function injects CSS style code right into the HTML pages which means it&#8217;ll override your theme CSS file no matter what. That in turn is why it&#8217;ll work on any theme as long as you run WordPress 3.0 or higher.</p>
<h2>Adding Featured Image (post-thumbnail) Functionality</h2>
<p>Featured images are great, if you know how to use them. They also do way more than just displaying thumbnails (which is why I think the function should be renamed). To activate the function add the following code to your functions.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will add the function to you Admin panel. To display the featured image (in the size you want) in your theme use one of the following functions:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Variations:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'medium'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'large'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>nnn<span style="color: #339933;">,</span>nnn<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Custom Page Templates</h2>
<p>Custom page templates allow you to individualize the look of different pages on your site. They can be used to create <a href="http://reeltimevideoworks.com/" title="Reeltime Videoworks front page" target="_blank">custom front pages</a>, <a href="http://www.frugalbits.com/editorial-policy/" title="Frugalbits legal pages" target="_blank">differentiated legal pages</a> or even <a href="http://www.frugalbits.com/cheap-sheet/" title="Frugalbits Cheap Sheet page" target="_blank">custom query pages</a> that pull in posts from multiple categories.</p>
<p>A custom page template is basically a regular page template with a commented out tag at the very top that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">/* Template Name: Whatever */</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Custom Category Templates</h2>
<p>Custom category templates can be used to create differentiated category index sections in a site. Some good examples are the <a href="http://reeltimevideoworks.com/category/videos/" title="Reeltime Videoworks show reel" target="_blank">Reeltime Videoworks show reel page</a> and <a href="http://reeltimevideoworks.com/category/testimonials/" title="Reeltime Videoworks Testimonials" target="_blank">testimonials page</a> and <a href="http://designschooledkids.com/category/press/" title="Design Schooled Kids press page" target="_blank">Design Schooled Kids&#8217; press page</a>.</p>
<p>A custom category template can be made in one of two ways. Either create a file with the name category-ID.php where ID is the ID number of the category or category-slug.php where slug is the slug for the category. These files will automatically become the category tempaltes for the defined categories.</p>
<h2>Custom Header, Sidebar and Footer</h2>
<p>You can also create custom headers, sidebars and footers sort of the same way. You make and call them the same way. For example if you want a custom header you create a new header file called header-custom.php and then call it using the standard get_header() function with a small difference:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'custom'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>where &#8216;custom&#8217; can be anything.</p>
<h2>Better Context Links</h2>
<p>One of the things that bug me about standard WordPress themes is that they display links to the next and previous posts in the single post view. These links don&#8217;t really provide a lot of value. Instead you should be displaying the two latest posts from the current category. So I made a small theme add-in you can dump into your theme for some better context. The add-in adds links to the two latest posts in the current category including the title, publishing date and short description. To install it download the <a href="http://designisphilosophy.com/themes/related.php" title="Related.php" target="_blank">related.php file here</a> (right-click and choose &#8220;Save As&#8221; &#8211; it&#8217;s a straight up php file), add it to your theme directory and call it using the following code in your single.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_template_part<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'related'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That&#8217;s all you have to do.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/wordcamp-victoria-presentation-10-theme-hacks-to-improve-your-site/' addthis:title='WordCamp Victoria Presentation: 10 Theme Hacks to Improve Your Site' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/wordcamp-victoria-presentation-10-theme-hacks-to-improve-your-site/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

