<?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>Philip Walton</title>
	<atom:link href="http://www.philipwalton.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philipwalton.com</link>
	<description>Web Design &#38; Development</description>
	<lastBuildDate>Sat, 17 Mar 2012 23:29:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Per Post Scripts &amp; Styles</title>
		<link>http://www.philipwalton.com/2011/09/25/per-post-scripts-and-styles/</link>
		<comments>http://www.philipwalton.com/2011/09/25/per-post-scripts-and-styles/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 22:22:22 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=203</guid>
		<description><![CDATA[If you&#8217;ve ever tried to post a tutorial or demonstration of Javascript or CSS on a WordPress blog, you&#8217;ve inevitably faced the challenge of figuring out how to load the scripts and styles for just that post. The easy way [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_204" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><img class="size-full wp-image-204 " title="Per Post Scripts &amp; Styles" src="http://philipwalton.com/wp-content/uploads/2011/09/per-post-scripts-and-styles.jpg" alt="Per Post Scripts &amp; Styles" width="640" height="360" /><figcaption class="screen-reader-text">Per Post Scripts &amp; Styles</figcaption></div></figure>
<p>If you&#8217;ve ever tried to post a tutorial or demonstration of Javascript or CSS on a WordPress blog, you&#8217;ve inevitably faced the challenge of figuring out how to load the scripts and styles for just that post.</p>
<p>The easy way is to add the styles to your main stylesheet and add the Javascript code to your main Javascript file (if you have one), but that&#8217;s not really a very nice thing to do to your viewers, especially if you have lots of posts with large amounts of code. Visitors end up downloading code for posts they&#8217;ll likely never visit, and every time you want to a new post, those files will have to be recached.</p>
<p>A better way would be to only load post-specific Javascript and CSS when you&#8217;re looking at that particular post. Unfortunately, WordPress doesn&#8217;t provide a built-in way to do this.</p>
<p>I&#8217;ve seen a few plugins that try to solve this problem, but all of them are pretty hackish and don&#8217;t have nearly enough customization options. So after much frustration with the existing plugins, I decided to write my own.</p>
<p>Allow me to introduce <a href="http://wordpress.org/extend/plugins/per-post-scripts-and-styles">Per Post Scripts &amp; Styles</a>. You can download the <a href="http://wordpress.org/extend/plugins/per-post-scripts-and-styles">plugin hosted on WordPress.org</a> or follow the <a href="https://github.com/philipwalton/per-post-scripts-and-styles">source on Github.</a></p>
<h2>Why it&#8217;s better</h2>
<ul>
<li>Dynamic URLs with <code>%SITE_URL%</code> and <code>%THEME_URL%</code> variables</li>
<li>Script dependency support as well as script duplication checking</li>
<li>The option to load scripts in either the header and footer</li>
<li>Attach scripts to posts, pages, and custom post types</li>
<li>Load attached scripts and styles not just on that post&#8217;s page, but on the home page or any other page where that post is displayed.</li>
</ul>
<p>Perhaps the worst thing about the existing plugins is they force you to hard code your script and style URLs. Not only is this bad practice, but it&#8217;s particularly inconvenient if (like me) you do most of your development locally, and then upload to your server. Obviously if I attach <code>http://localhost:8888/javscript/some-file.js</code> to a post, that&#8217;s not going to work when it to my production server. This also applies to anytime you need to switch to URLs. Per Post Scripts &amp; Styles allows you to use variables like <code>%SITE_URL%</code> and <code>%THEME_URL%</code> making this issue much easier to manage.</p>
<p>Another big problem with the existing plugins is they simply collect your URLs and plop them out in the header. This goes against WordPress best practices for two very compelling reasons: (1) no duplication checking and (2) no dependency checking. Imagine if you wanted to include a that required jQuery to run. You could list jQuery as one of the scripts to attach, but what if another plugin is already loading jQuery? Now you&#8217;ll be loading it twice!</p>
<p>Per Post Scripts &amp; Styles takes care of all these issues for you. A meta box is added to every post, page, or custom post type you choose, and all you have to do is specify which the URLs should be loaded. The plugin takes care of the rest.</p>
<h2>Documentation</h2>
<h3>Edit Post Screen</h3>
<p>In the edit post screen there is a meta box below the post content box titled &#8220;Per Post Scripts &amp; Styles&#8221;. Simply enter the URLs of any Javascript or CSS files that you want to load in the appropriate box.</p>
<p><strong>Instructions</strong></p>
<ul>
<li>When entering the URLs, you may use the variables <code>%SITE_URL%</code> and <code>%THEME_URL%</code> for greater flexibility, e.g. <code>%SITE_URL%/scripts/this-post-script.js</code></li>
<li>To have multiple scripts, put each on on its own line.</li>
<li>If your script has one or more dependencies, add them as a comma separated list in braces at the end of the URL, e.g. <code>%SITE_URL%/scripts/code.js{jquery,json2}.</code> Here is a <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress">list of possible dependencies</a> that ship with WordPress.</li>
</ul>
<dl>
<dt>Header Scripts</dt>
<dd>List script URLs to be enqueued in the header.</dd>
<dt>Footer Scripts</dt>
<dd>List script URLs to be enqueued in the footer. (The footer is often the best place to put Javascript files because it doesn&#8217;t slow the loading of the other HTML content.)</dd>
<dt>Styles</dt>
<dd>List stylesheet URLs.</dd>
<dt>Extras</dt>
<dd>Hardcode Javascript or CSS here. It will be outputted right before the &lt;/header&gt; tag. Make sure to properly use the <code>&lt;script&gt;</code> and <code>&lt;style&gt;</code> tags. Note: while this is primarily used for Javascript and CSS, the contents of this box is dumped at the end of the header on the page. Anything extra you want to put in the header when this specific post is loaded can go here.</dd>
</dl>
<h3>Settings Page</h3>
<dl>
<dt>Allow Per Post Scripts &amp; Styles For The Following Post Types:</dt>
<dd>Choose one or more of the post types to allow attaching specific scripts and styles to. If you have custom post types, they will appear in this list as well.</dd>
</dl>
<dl>
<dt>Only Load Scripts &amp; Styles When</dt>
<dd>Most of the time you will want to select single post pages only. The only exception is if you&#8217;re displaying the full content (not just the excerpt) of a post on another page. This blog, for example, is using the second option because it displays the full content of some posts on the home page. Keep in mind, however, that selecting all pages will add a considerable amount of overhead to each page load since it will have to query the database for every post loaded on every page. Only use this if absolutely necessary.</dd>
</dl>
<h2>Questions / Feedback</h2>
<p>If you have any questions, feedback or suggestions, please leave a comment. I’m always looking to make my plugins better, and I don’t always know how people are using them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/09/25/per-post-scripts-and-styles/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Fluid Images with Captions</title>
		<link>http://www.philipwalton.com/2011/07/23/fluid-images-with-captions/</link>
		<comments>http://www.philipwalton.com/2011/07/23/fluid-images-with-captions/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 18:35:59 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=182</guid>
		<description><![CDATA[Fluid images are nothing new. If you want to have images on your site that scale down as their containers elements — or the browser itself — gets smaller, there is no shortage of tutorials on the Web explaining exactly [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_187" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><img class="size-full wp-image-187 " title="Fluid Images with Captions" src="http://philipwalton.com/wp-content/uploads/2011/07/fluid-images.jpg" alt="Fluid Images with Captions" width="640" height="360" /><figcaption class="screen-reader-text">Fluid Images with Captions</figcaption></div></figure>
<p>Fluid images are nothing new. If you want to have images on your site that scale down as their containers elements — or the browser itself — gets smaller, there is no shortage of tutorials on the Web explaining exactly how. (In case you&#8217;re wondering, the trick is to apply the CSS rules <code>max-width:100%</code> and <code>height:auto</code> to the <code>img</code> tag.)</p>
<p>But the problem is most of the time you don&#8217;t just want fluid images, you want your captions to be fluid too.</p>
<h2>Requirements</h2>
<ul>
<li>As the container gets smaller than the image&#8217;s width, the images scales down, proportionately, inside of it.</li>
<li>If the container is bigger than the image&#8217;s width, the image and caption float left and the text wraps around it.</li>
<li>There is an appropriate margin on the right side of the image when text wraps around it; when text isn&#8217;t wrapping and the image is 100%, that same amount of margin is present between the right edge of the image and the right edge of the container.</li>
<li>The image and caption should have some sort of border around them to visually tie them together.</li>
<li>The caption should be directly below the image with no space or gap between them.</li>
<li>The image caption should have a reasonable amount of padding on all sides and a reasonable line-height so if the caption is longer than one line, it looks natural and doesn&#8217;t touch any edges.</li>
<li>It renders properly in Firefox, Chrome, Safari, Opera, and IE7+</li>
</ul>
<h2>The Markup</h2>
<p>I&#8217;ll take my example from WordPress, since that&#8217;s what most people use.</p>
<p>When WordPress creates a caption, it adds a wrapper <code>div.wp-caption</code> around both the image and the <code>p.wp-caption-text element</code>. Here&#8217;s what it might look like.</p>
<pre>&lt;div style="width:610px;"&gt;
   &lt;a href="#"&gt;&lt;img src="starry-night.jpg" alt="Starry Night" width="600" height="375" /&gt;&lt;/a&gt;
   &lt;p class="wp-caption-text"&gt;This is a really, really, really, really, long caption that might have to wrap several times to fully describe what this particular picture is actually about in the most detailed terms possible.&lt;/p&gt;
&lt;/div&gt;</pre>
<p>This is nice, but it&#8217;s not going to work for what we I want to do. Fortunately, WordPress makes it really easy for us to change the default caption markup. (If you&#8217;re not sure how, here&#8217;s a <a href="http://devpress.com/blog/captions-in-wordpress/" target="_blank">good tutorial</a>.)</p>
<pre>&lt;div class="wp-caption" style="width:620px;"&gt;
   &lt;div class="wp-caption-wrapper"&gt;
      &lt;a href="#"&gt;&lt;img src="starry-night.jpg" alt="Starry Night" width="600" height="375" /&gt;&lt;/a&gt;
      &lt;p class="wp-caption-text"&gt;This is a really, really, really, really, long caption that might have to wrap several times to fully describe what this particular picture is actually about in the most detailed terms possible.&lt;/p&gt;
   &lt;/div&gt;
&lt;/div&gt;</pre>
<p>Ahh, much better. I&#8217;ve changed the container width to 20 pixels larger than the image because I want a 10 pixel border instead of a 5 pixel border, and I&#8217;ve added an extra <code>div</code> element around the image and caption.</p>
<h2>The Styles</h2>
<pre>.wp-caption {
   background-color:#fff;
   float:left;
   margin: 0 20px 10px 0;
   max-width:100%;
   -moz-box-shadow:0 0 5px rgba(0,0,0,.4);
   -webkit-box-shadow:0 0 5px rgba(0,0,0,.4);
   box-shadow:0 0 5px rgba(0,0,0,.4);
}
.wp-caption-wrapper {
   padding:10px;
}
.wp-caption-text {
   background-color:#2E6182;
   color:#fff;
   font-size:.8em;
   margin:0;
   padding:6px 8px;
}
.wp-caption img {
   background-color:#2E6182;
   border:none;
   display:block;
   height:auto!important;
   width:auto!important; /* auto is needed to fix a bug in IE8 */
   max-width:100%!important;
}</pre>
<p>The styles should be pretty self-explanatory is you&#8217;re familiar with CSS, but let me explain some of the finer points and some of the areas I got stuck on when figuring this out.</p>
<ul>
<li>You need to use <code>max-width:100%</code> on both the <code>div.wp-caption</code> container and the image itself.</li>
<li>The image needs to be set to <code>display:block</code>. Images default to <code>display:inline</code>, and if you leave it like that, you&#8217;ll see a space between the image and the caption.</li>
<li>Set the background color of the image to the same as the background color of the caption. As browsers are shrinking the image, sometimes there will be a 1 pixel space between the image and the caption. A background color makes this unnoticeable.</li>
</ul>
<p>That&#8217;s it! Check out this <a href="http://philipwalton.com/demos/fluid-images-with-captions/index.html" target="_blank">demo</a> to see it in action.</p>
<h2>For advances users</h2>
<p>If you&#8217;re looking at the extra wrapper div and wonder why I didn&#8217;t just use <code>box-sizing:border-box</code>, there are basically two reasons:</p>
<ul>
<li>Box sizing is only supported in IE8+, so IE7 won&#8217;t display this properly.</li>
<li>There&#8217;s a bug in IE8 where <code>box-sizing</code> and <code>max-width</code> don&#8217;t play nice together. This has been fixed in IE9, but in IE8 as the container gets smaller, <code>max-width:100%</code> is applied to the content box and not the border box.</li>
</ul>
<p>However, if you don&#8217;t have to support IE8, I&#8217;ve also put together a <a href="http://philipwalton.com/demos/fluid-images-with-captions/box-sizing.html" target="_blank">demo</a> using <code>box-sizing:border-box</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/07/23/fluid-images-with-captions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PW_Typer</title>
		<link>http://www.philipwalton.com/2011/07/04/pw_typer/</link>
		<comments>http://www.philipwalton.com/2011/07/04/pw_typer/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 05:28:11 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=175</guid>
		<description><![CDATA[PW_Typer is a jQuery plugin that seeks to mimic the look of letters being typed on the page like a typewritter. To use PW_Typer, clone the source on GitHub. Methods type jQuery.type({option1: value1, option2: value2 ... etc.}); Types out content, [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_176" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><img class="size-full wp-image-176 " title="Typewriter" src="http://philipwalton.com/wp-content/uploads/2011/07/typer.jpg" alt="Typewriter" width="640" height="360" /><figcaption class="screen-reader-text">Typewriter</figcaption></div></figure>
<p><a href="https://github.com/philipwalton/PW_Typer">PW_Typer</a> is a jQuery plugin that seeks to mimic the look of letters being typed on the page like a typewritter. To use PW_Typer, clone <a href="https://github.com/philipwalton/PW_Typer">the source</a> on GitHub.</p>
<h2>Methods</h2>
<h3>type</h3>
<pre><code>jQuery.type({option1: value1, option2: value2 ... etc.});</code></pre>
<p>Types out content, one character at a time. Speed and variation can be specified through the various parameters.</p>
<h3>untype</h3>
<pre><code>jQuery.untype({option1: value1, option2: value2 ... etc.});</code></pre>
<p>Removes content, one character at a time. Speed and variation can be specified through the various parameters.</p>
<h3>stopTyper</h3>
<pre><code>jQuery.stopTyper();</code></pre>
<p>Stops or pauses a type or untype function that is in progress.</p>
<h3>resumeTyper</h3>
<pre><code>jQuery.resumeTyper();</code></pre>
<p>Resumes a type or untype function that has been stopped.</p>
<h3>finishTyper</h3>
<pre><code>jQuery.finishTyper();</code></pre>
<p>Imediately completes a type or untype function that is in progress. If a callback function was specified, it is called right away.</p>
<h2>Optional Parameters</h2>
<dl>
<dt>callback:</dt>
<dd>(Function) A function to be called once all typing is complete. If the jQuery object contains more than one element, the callback function is called once the last element is complete.</dd>
<dt>content:</dt>
<dd>(String, <em>default: $(this).html()</em>) The HTML content (or plain text) to be typed. The content can be as complex as you want, the only requirement is that script tags cannot be used within the string.</dd>
<dt>delay:</dt>
<dd>(Number) Time (in millaseconds) before the type function starts</dd>
<dt>deviation:</dt>
<dd>(Number) Possible values range from 0 to 1. The deviation Indicates how likely the interval between each typed character deviates from the average time. A deviation of 0 would be no deviation at all, and a deviation of 1 would be up to up to 100% of the average interval. In other words, if the average interval were 100 milliseconds and the deviation were 1, the interval values would range from 0 to 200. If the deviation were .5, interval values would range from 50 to 150. (Note: Average time is total time divided by the total number of characters in the content string. If the time parameter is not specified, deviation is ignored)</dd>
<dt>minInterval:</dt>
<dd>(Number, <em>default: 30</em>) Minimum interval (in milliseconds) between the typing of each letter. The interval is a random time between minInterval and maxInterval. (Note: if the time parameter is specified, this value is ignored)</dd>
<dt>maxInterval:</dt>
<dd>(Number, <em>default: 90</em>) Maximum elapsed time (in milliseconds) between the typing of each letter. The interval is a random time between minInterval and maxInterval. (Note: if the time parameter is specified, this value is ignored)</dd>
<dt>time:</dt>
<dd>(Number) The total elapsed time (in milliseconds) to type all characters in the content string. (Note: Times will not be exact and vary based on browser and computer speed.)</dd>
</dl>
<h2>Examples</h2>
<ul id="examples" class="is-reset">
<li id="example-1">
<h3>Typing simple text</h3>
<pre><code>$("p").type();</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>This is just some simple text. No HTML elements here.</p>
</div>
</li>
<li id="example-2">
<h3>Typing HTML content</h3>
<pre><code>$("p").type();</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>This is <em>more</em> complex <strong>HTML</strong> content. As you can see there are <strong>HTML</strong> tags &amp; special characters within this &lt;p&gt; element.</p>
</div>
</li>
<li id="example-3">
<h3>Specifying the content to type</h3>
<pre><code>$("p").type({ content:"This is the &lt;strong&gt;content&lt;/strong&gt; I want you to type." });</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>This text will be replaced with new text passed via the <code>content</code> parameter.</p>
</div>
</li>
<li id="example-4">
<h3>Using <code>minInterval</code> and <code>maxInterval</code> to make the typing seems much more irratic</h3>
<pre><code>$("p").type({ minInterval:10, maxInterval:200 });</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>Notice how the interval between each character is very, very different.</p>
</div>
</li>
<li id="example-5">
<h3>Using <code>time</code>, <code>delay</code>, and <code>callback</code></h3>
<pre><code>$("p").type({ time:5000, delay:1000, callback:function() { alert("Typing Complete!"); } });</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>This text should type out completely in approximately 5 seconds with an additional 1 second delay before it begins. Because the <code>deviation</code> parameter isn’t specified, the interval between each character is exactly the same.</p>
</div>
</li>
<li id="example-6">
<h3><code>untype</code> and <code>deviation</code></h3>
<pre><code>$("p").untype({ time:5000, deviation:.8 });</code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p><code>untype</code> works exactly the same as <code>type</code> but in reverse. The <code>deviation</code> parameter adds a little variance to the time interval between characters into order to make the typing or untyping seem more natural.</p>
</div>
</li>
<li id="example-7">
<h3><code>pauseTyper</code>, <code>resumeTyper</code>, <code>finishTyper</code> and multiple elements simultaneously.</h3>
<pre><code>$("p").type({time: 16000}).each( function() { $(this).hover( function() { $(this).stopTyper(); }, function() { $(this).resumeTyper(); }); $(this).click( function() { $(this).finishTyper(); }); }); </code></pre>
<input type="button" value="Demo" />
<div class="demo">
<p>Paragraph 1: Hover your mouse over this paragraph to stop the typer applying the stopTyper() function. When your mouse is no longer hovering over the paragraph, the typing will resume via the resumeTyper() function. Click anywhere within this paragraph to apply the finishTyper() function.</p>
<p>Paragraph 2: Hover your mouse over this paragraph to stop the typer applying the stopTyper() function. When your mouse is no longer hovering over the paragraph, the typing will resume via the resumeTyper() function. Click anywhere within this paragraph to apply the finishTyper() function.</p>
<p>Paragraph 3: Hover your mouse over this paragraph to stop the typer applying the stopTyper() function. When your mouse is no longer hovering over the paragraph, the typing will resume via the resumeTyper() function. Click anywhere within this paragraph to apply the finishTyper() function.</p>
</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/07/04/pw_typer/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Redesigned Responsively</title>
		<link>http://www.philipwalton.com/2011/05/24/redesigned-responsively/</link>
		<comments>http://www.philipwalton.com/2011/05/24/redesigned-responsively/#comments</comments>
		<pubDate>Wed, 25 May 2011 05:39:29 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Responsive Web Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=138</guid>
		<description><![CDATA[I finally got around to finishing my new WordPress theme for this site. It&#8217;s been too long. I mean, who could take seriously a Web designer whose company portfolio blog used TwentyTen? One of the reasons for the holdup was [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_139" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><img class="size-full wp-image-139" title="Philip Walton Site Redesign" src="http://philipwalton.com/wp-content/uploads/2011/05/philipwalton.jpg" alt="Philip Walton Site Redesign" width="640" height="360" /><figcaption class="screen-reader-text">Philip Walton Site Redesign</figcaption></div></figure>
<p>I finally got around to finishing my new WordPress theme for this site. It&#8217;s been too long. I mean, who could take seriously a Web designer whose company portfolio blog used TwentyTen?</p>
<p>One of the reasons for the holdup was I really wanted to make this new theme responsive. If you&#8217;re not familiar with that term, in essence it&#8217;s the practice of building a website whose look and layout respond to the browser or device displaying it. For a more in-depth explanation, see <a href="http://www.alistapart.com/articles/responsive-web-design/" target="_blank">A List Apart&#8217;s article</a> on the subject.</p>
<p>In the web industry these days responsive design is all the rage. Some even suggest that if you&#8217;re not doing it, you&#8217;re not a &#8220;real&#8221; Web designer. I have mixed reactions to that sentiment. For one thing, not all clients care about it nor are they all willing to pay for the extra time required to do it.</p>
<p>Those that do taught the importance of responsive design usually bring up the need to support mobile devices. But when I look at the analytics for all the sites I track, the percentage of pageviews I have from mobile devices is still relatively small — under 5% for most sites. Don&#8217;t get me wrong, I&#8217;m not suggesting that mobile isn&#8217;t important, I just can&#8217;t help but point out the hypocrisy of the ease in which someone will discount IE 6 and 7 users (which is easily still over 5% for almost all sites) but insist that we must cater to mobile users, even though they&#8217;re a smaller percentage, and the data show they spend far less time on your site.</p>
<p>But, I&#8217;m not writing this to bash responsive design; rather, I want to defend its use for a more obvious — but often overlooked — reason: and that&#8217;s screen resolution. About 8% of my viewers have a max resolution of 1024 by 768, but another 8% have a resolution almost double that. In fact I have over ten different max display settings at 5% or more. The days of being able to assume that the majority of your visitors would have one or two different screen resolutions are long gone. And as far as I&#8217;m concerned, so should be the days of creating a 960 pixel design, slapping a drop shadow behind it, and calling it finished.</p>
<p>Responsive design shouldn&#8217;t be just about creating a desktop version and a mobile version, it should be about creating a fluid layout that makes the most of every square inch it&#8217;s been given, no matter what the size. It&#8217;s not always easy to envision the best way to layout your content for a half dozen different possible browser widths, but in my experience, doing so forces you to be more intentional in your design. And in the end, I believe intention more than looks is one of the primary separators between good and bad design.</p>
<p>Well, enough talk. I hope you like the look of the new site, and if you have any questions about how I did something, just let me know in the comments below — or to the right depending on how wide your browser window is!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/05/24/redesigned-responsively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tennis En Fuego</title>
		<link>http://www.philipwalton.com/2011/05/23/tennis-en-fuego/</link>
		<comments>http://www.philipwalton.com/2011/05/23/tennis-en-fuego/#comments</comments>
		<pubDate>Tue, 24 May 2011 04:05:27 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=133</guid>
		<description><![CDATA[Bryn Mercado, friend and fellow tennis enthusiast, recently approached me to redesign Tennis En Fuego, his blog about all things tennis. In his own words: Tennis En Fuego is a digital and interactive blog and website encompassing all of the [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_134" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><img class="size-full wp-image-134 " title="Tennis En Fuego" src="http://philipwalton.com/wp-content/uploads/2011/05/tef.jpg" alt="Tennis En Fuego" width="640" height="360" /><figcaption class="screen-reader-text">Tennis En Fuego</figcaption></div></figure>
<p>Bryn Mercado, friend and fellow tennis enthusiast, recently approached me to redesign <a href="http://tennisenfuego.com" target="_blank">Tennis En Fuego</a>, his blog about all things tennis. In his own words:</p>
<blockquote><p>Tennis En Fuego is a digital and interactive blog and website encompassing all of the qualities we love about tennis. Every week, our goal is to portray the same kind of fire online that we see on the court.</p>
<p>The sport of tennis is in the middle of an amazing era. Never before have we seen such a high level of athleticism, player depth, and new equipment technology all coming together to produce uncanny competition. Now with mediums such as the internet, twitter, facebook, blogs, etc… tennis can be shared more than ever. TEF wants to be right in the middle of this evolution, providing informative content from all sides of the game.</p></blockquote>
<p>The site is built as a custom WordPress theme incorporating social features for sharing content via Facebook and Twitter; all the theme options are completely customizable from the back end. The design tries to reflect the mood the title conveys yet at the same time make the viewer forget he&#8217;s not reading an article on ESPN.com. Hopefully the subtleties are not lost on the average tennis reader. As a fan myself, I&#8217;d like to think they won&#8217;t be.</p>
<p>Good luck with the site Bryn. I&#8217;m confident you won&#8217;t let your readers down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/05/23/tennis-en-fuego/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone App Mentioned In Local Newspaper</title>
		<link>http://www.philipwalton.com/2011/04/28/iphone-app-mentioned-in-local-newspaper/</link>
		<comments>http://www.philipwalton.com/2011/04/28/iphone-app-mentioned-in-local-newspaper/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 02:45:34 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=102</guid>
		<description><![CDATA[It must have been a slow news day if Westmont&#8217;s releasing an update to their iPhone app made it in the local paper, but I guess I shouldn&#8217;t be complaining. For the record, this was my first attempt at building [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_131" class="wp-caption shadow alignleft" style="width: 300px"><div class="wp-caption-wrapper"><img class="size-medium wp-image-131" title="Westmont iPhone App" src="http://philipwalton.com/wp-content/uploads/2011/04/westmont_app-300x450.jpg" alt="Westmont iPhone App" width="300" height="450" /><figcaption class="screen-reader-text">Westmont iPhone App</figcaption></div></figure>
<p>It must have been a slow news day if Westmont&#8217;s releasing an update to their iPhone app <a href="http://www.noozhawk.com/article/042811_westmont_college_releases_updated_iphone_app" target="_blank">made it in the local paper</a>, but I guess I shouldn&#8217;t be complaining.</p>
<p>For the record, this was my first attempt at building an iPhone application, and I&#8217;m pretty happy with how it turned out.  Unfortunately, there wasn&#8217;t room for a lot of really cool features in this version; I was mainly just duplicating the functionality of the existing app, which was developed by an outside company using <a href="http://www.nimblekit.com/index.php" target="_blank">NimbleKit</a>, a framework that allows developers to write native iPhone apps with just HTML, CSS, and Javascript. My update was a complete rewrite in Objective-C (I also used the wonderful and open-source <a href="http://three20.info/" target="_blank">Three20 framework</a>).</p>
<p>We didn&#8217;t make the switch from NimbleKit to Objective-C lightly. At first, an application built on open web technologies that lots of people know seemed like the way to go, but we quickly realized just how limiting it could be (not to mention the fact that it ran incredibly slowly). Under the hood, all NimbleKit does is essentially put the entire application in one big UIWebView (i.e. Safari), which means that in addition to being necessarily less efficient, there was no easy way to take advantage of the iPhone 4&#8242;s retina display. So not only did it run slower, but it looked crappier too.</p>
<p>If anyone else is considering using a framework to write native iPhone apps in HTML, CSS, and Javascript it, I&#8217;d recommend against it.  My advice is to bite the bullet, learn Objective-C, and do it the hard way. You&#8217;ll be glad you did.</p>
<p>If you want to check out the app, just search for &#8220;Westmont&#8221; in the app store.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/04/28/iphone-app-mentioned-in-local-newspaper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zen Coding for PHP and WordPress</title>
		<link>http://www.philipwalton.com/2011/04/06/zen-coding-for-php-and-wordpress/</link>
		<comments>http://www.philipwalton.com/2011/04/06/zen-coding-for-php-and-wordpress/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 23:27:16 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=75</guid>
		<description><![CDATA[I&#8217;ve been using Zen Coding for about a year now, and I can&#8217;t understate how great the idea is. Its value should be immediately apparent to anyone who has experience writing HTML by hand. But in the past year I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_80" class="wp-caption shadow alignnone" style="width: 600px"><div class="wp-caption-wrapper"><img class="size-full wp-image-80 " title="Zen Coding in Action" src="http://philipwalton.com/wp-content/uploads/2011/04/PW_Zen_Coder.jpg" alt="Zen Coding in Action" width="600" height="286" /><figcaption class="screen-reader-text">Zen Coding in Action</figcaption></div></figure>
<p>I&#8217;ve been using <a href="http://code.google.com/p/zen-coding/" target="_blank">Zen Coding</a> for about a year now, and I can&#8217;t understate how great the idea is. Its value should be immediately apparent to anyone who has experience writing HTML by hand. But in the past year I&#8217;ve started doing a lot more server side programming and a lot less HTML by hand, so I don&#8217;t get to take advantage of Zen Coding as much as I once did.</p>
<p>Sill, I constantly find myself in situations where I need to programmatically create a bunch of nested HTML elements in PHP, and I wonder: why isn&#8217;t there a PHP function that can take a Zen Coding selector and automatically expand it?</p>
<p>Well, when you wonder something enough times, eventually you decide to actually do something about it.</p>
<p>I&#8217;ve created a PHP class called PW_Zen_Coder, and I&#8217;ve put the <a href="https://github.com/philipwalton/PW_Zen_Coder" target="_blank">source on github</a> if anyone wants to grab it or contribute. I&#8217;ve also set it up as a WordPress plugin, so you can drop it into your plugins directory, activate it, and then use PW_Zen_Coder in any of your own code.</p>
<h2>Documentation</h2>
<p>PW_Zen_Coder has only one public method, <code>expand()</code>. This may grow in the future as Zen Coding itself changes, but at the the moment all it does is expand a Zen Coding selector into valid HTML ready for output.</p>
<h3>expand( )</h3>
<p>Consumes a Zen Coding selector, along with whatever passed values, and returns a valid string of HTML code ready for output.</p>
<pre><code>public string PW_Zen_Coder::expand( string $selector , mixed $text [, </code><code>array</code><code> $...] )</code></pre>
<h4>Parameters</h4>
<dl>
<dt>selector</dt>
<dd><code>(String)</code> A selector according to <a href="http://code.google.com/p/zen-coding/" target="_blank">Zen Coding syntax</a>. See below for a list of specific selectors not supported.</dd>
<dt>text</dt>
<dd><code>(Mixed)</code> A string that will be the innerHTML value of the last element in the selector. If element multiplication (e.g. &#8220;li*4&#8243;) is applied and you want different values for each element, pass an array of values that correspond to each iteration of the multiplied element.</dd>
</dl>
<dl>
<dt>&#8230;</dt>
<dd><code>(Array)</code> Pass additional arrays that correspond to indexed values (e.g. {%1}, {%2}, etc.) within the selector. The passed array(s) should be a list of key/value pairs that correspond to HTML attribute/properties respectively. If element multiplication is used, pass an array of such arrays.</dd>
</dl>
<h4>Return Value</h4>
<p>Returns the HTML string produced.</p>
<h2>Examples</h2>
<p>All examples below assume the existence of a PW_Zen_Coder instance variable named <code>$zc</code> .</p>
<pre>$zc = new PW_Zen_Coder;</pre>
<h3>A Simple Example</h3>
<p>This is an example of very basic usage, but even here the process of creating an element with a class and a sub-element is significantly simplified.</p>
<pre>echo $zc-&gt;expand('.wrapper&gt;p', 'Hello World');</pre>
<p>Becomes:</p>
<pre>&lt;div class="wrapper"&gt;
  &lt;p&gt;Hello World&lt;/p&gt;
&lt;/div&gt;</pre>
<h3>A Complex Example</h3>
<p>Here is a much more complex example. While the selector is somewhat difficult to read, imagine how much easier it would be to edit the markup if down the road you decided to change the structure slightly.</p>
<pre>echo $zc-&gt;expand(
  '#page.js&gt;#header&gt;.wrapper&gt;h1[title="Slogan"]&gt;a[href="http://google.com"]',
  'Hello World'
);</pre>
<p>Becomes:</p>
<pre>&lt;div id="page"&gt;
  &lt;div id="header"&gt;
    &lt;div class="wrapper&gt;
      &lt;h1 title="Slogan"&gt;&lt;a href="http://google.com"&gt;Hello World&lt;/a&gt;&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<h3>Element Multiplication</h3>
<p>Adding *N to an element outputs it N times. The $ character in an ID or class is replaced with the iteration number. Notice how this time an array is pass to <code>$text</code> instead of a string.</p>
<pre>echo $zc-&gt;expand(
  'ul&gt;li.item$*6',
  array("Red","Orange","Yellow","Green","Blue","Violet")
);</pre>
<p>Becomes:</p>
<pre>&lt;ul&gt;
  &lt;li class="item1"&gt;Red&lt;/li&gt;
  &lt;li class="item2"&gt;Orange&lt;/li&gt;
  &lt;li class="item3"&gt;Yellow&lt;/li&gt;
  &lt;li class="item4"&gt;Green&lt;/li&gt;
  &lt;li class="item5"&gt;Blue&lt;/li&gt;
  &lt;li class="item6"&gt;Violet&lt;/li&gt;
&lt;/ul&gt;</pre>
<h3>Element Multiplication (dynamically and with multiple $&#8217;s)</h3>
<p>The real power of Zen Coding in evident when you start constructing the selector dynamically. Here is a basic example of doing just that. Also notice how $$ becomes 01, 02, 03 instead of 1, 2, 3.</p>
<pre>$numbers = array("One","Two","Three");
echo $zc-&gt;expand(
  'ul&gt;li.item$$*' . count($numbers),
  $numbers
);</pre>
<p>Becomes:</p>
<pre>&lt;ul&gt;
  &lt;li class="item01"&gt;One&lt;/li&gt;
  &lt;li class="item02"&gt;Two&lt;/li&gt;
  &lt;li class="item03"&gt;Three&lt;/li&gt;
&lt;/ul&gt;</pre>
<h3>Passing HTML Attributes to Elements</h3>
<p>If you want to apply additional HTML attributes to an element, include {%N} in your selector and pass another argument in the method call.</p>
<pre>echo $zc-&gt;expand(
  '#sample&gt;pre{%1}&gt;code',
  array('title'=&gt;'code', 'width'=&gt;'600px'),
  'Pre-formatted Code Block'
);</pre>
<p>Becomes:</p>
<pre>&lt;div id="sample"&gt;
  &lt;pre width="600px" title="code"&gt;
    &lt;code&gt;Pre-formatted Code Block&lt;/code&gt;
  &lt;/pre&gt;
&lt;/div&gt;</pre>
<h3>Passing HTML Attributes to Elements with Element Multiplication</h3>
<p>If you pass an array of attributes to an element that has been multiplied, each element will possess the exact same set of attributes. If you want them to possess different attributes, simply pass an array of arrays instead of just one array. This example shows both methods:</p>
<pre>echo $zc-&gt;expand(
  'ul{%1}&gt;li*3{%2}&gt;span',
  array('style'=&gt;'background-color:#eee'),
  array(
    array('style'=&gt;'color:red'),
    array('style'=&gt;'color:green'),
    array('style'=&gt;'color:blue'),
  ),
  array( 'red', 'green', 'blue' )
);</pre>
<p>Becomes:</p>
<pre>&lt;ul style="background-color:#eee"&gt;
  &lt;li style="color:red"&gt;&lt;span&gt;red&lt;/span&gt;&lt;/li&gt;
  &lt;li style="color:green"&gt;&lt;span&gt;green&lt;/span&gt;&lt;/li&gt;
  &lt;li style="color:blue"&gt;&lt;span&gt;blue&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<h2>Differences from Zen Coding</h2>
<p>Some of the elements in the Zen Coding syntax do not make sense to be dynamically implemented, and some of the features I just haven&#8217;t decided how best to implement them. Here is a list of exactly what PW_Zen_Coder does and does not support.</p>
<h3>Supported features</h3>
<ul>
<li>ID and class attributes: <tt>div#page.section.main</tt></li>
<li>Custom attributes: <tt>a[title="Hello world"]</tt></li>
<li>Element multiplication: <tt>li*5</tt> will output <tt>&lt;li&gt;</tt> tag five times.</li>
<li>Item numbering with $ character: <tt>li.item$*3</tt> will output <tt>&lt;li&gt;</tt> tag three times, replacing $ character with item number</li>
<li>Multiple &#8216;$&#8217; characters in a row are used as zero padding, i.e.: <tt>li.item$$$</tt> will output <tt>li.item001</tt></li>
<li><tt>div</tt> tag name can be omitted when writing element starting from ID or class: <tt>#content&gt;.section</tt> is the same as <tt>div#content&gt;div.section</tt>.</li>
</ul>
<h3>Features Not Supprted</h3>
<ul>
<li>Abbreviation groups with unlimited nesting: <tt>div#page&gt;(div#header&gt;ul#nav&gt;li*4&gt;a)+(div#page&gt;(h1&gt;span)+p*2)+div#footer</tt>. <strong><br />
Note: </strong>You cannot use the + character to create sibling elements nor can you use parentheses to nest. If you want to nest or use siblings, just pass another PW_Zen_Coder instance as the $text argument.</li>
<li>Filters support</li>
</ul>
<h3>Partially Supported Features</h3>
<ul>
<li>Custom attributes: while <tt>a[title="Hello world"] is supported, a[title] and </tt><tt>a[title="Hello world" rel] are not. The attribute must have both the name and value. To have multiple attributes, just pass them as a method argument.</tt></li>
<li>Element multiplication: while element multiplication is possible, and it&#8217;s possible to do it multiple times within a selector, it is not always possible to do it multiple times within a selector while simultaneously passing the selector attribute values. For example: ul&gt;li*3{%1}&gt;p*2{%2} will probably not work as expected.</li>
</ul>
<h2>What&#8217;s next?</h2>
<p>If you want to try PW_Zen_Coder, just download the <a href="https://github.com/philipwalton/PW_Zen_Coder" target="_blank">source on github</a> and test it out. There is an example file included that should give you an idea of how it works.</p>
<p>If you have any questions, comments, complaints, suggestions, or if you find any bugs, let me know in the comments below and I&#8217;ll try to address them as quickly as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/04/06/zen-coding-for-php-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PW_Archives</title>
		<link>http://www.philipwalton.com/2011/02/08/pw_archives/</link>
		<comments>http://www.philipwalton.com/2011/02/08/pw_archives/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 04:42:59 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=5</guid>
		<description><![CDATA[Description PW_Archives is a fully-customizable yet light-weight and intuitive archiving plugin. Its features include custom post type support, optional javascript enhancement, shortcodes, and widgets all with only one additional database query. The primary goal of PW_Archives is to be light-weight [...]]]></description>
			<content:encoded><![CDATA[<h2>Description</h2>
<figure id="attachment_73" class="wp-caption shadow alignleft" style="width: 300px"><div class="wp-caption-wrapper"><img class="size-full wp-image-73" title="PW_Archives" src="http://philipwalton.com/wp-content/uploads/2011/02/PW_Archives-Screen-Shot.jpg" alt="PW_Archives" width="300" height="367" /><figcaption class="screen-reader-text">PW_Archives</figcaption></div></figure>
<p>PW_Archives is a fully-customizable yet light-weight and intuitive archiving plugin. Its features include custom post type support, optional javascript enhancement, shortcodes, and widgets all with only one additional database query.</p>
<p>The primary goal of PW_Archives is to be light-weight and efficient. I&#8217;ve tried almost all of the popular archiving plugins out there, and so many of them make hundreds or even thousands of queries depending on the number of posts you have on your site. PW_Archives makes only one query to get your posts. That&#8217;s it. Not only that but it doesn&#8217;t do endless amounts of looping and counting to determine post and comment counts. That&#8217;s all included in the one query it does, and it&#8217;s very efficient.</p>
<p>The second main goal of PW_Archives is customization. Almost everything is customizable. Select what post types to include, choose whether you want the javascript to fade in or slide down (or no javascript at all). You can even select the date format and add custom markup. If you don&#8217;t know HTML, don&#8217;t worry; the defaults will work for most people.</p>
<h2>Documentation</h2>
<p>PW_Archives works just like WordPress menus. If you&#8217;re familiar with using menus, PW_Archives will make perfect sense. The idea is that you can create multiple instances of a particular set of options, each with its own name for easy reference later. In other words, you can create two completely different configurations and easily switch between the two without losing all your previous settings.</p>
<p>For example, let&#8217;s say you want to list archives in your sidebar and only show year and month (not individual posts) and only for the most recent year.  However, you also want your archives listed on a dedicated archives page showing all years, all months, and all posts. Here&#8217;s how you&#8217;d do it:</p>
<ol>
<li> Create two PW_Archives instances, name one &#8220;Sidebar&#8221; and the other something like &#8220;Full&#8221;.</li>
<li>For the &#8220;Sidebar&#8221; instance, select &#8220;1&#8243; for &#8220;Years to Display:&#8221; and &#8220;Years &gt; Months&#8221; for &#8220;Archive Depth:&#8221;. For the &#8220;Full&#8221; instance, just use the defaults.</li>
<li> Next, add the PW_Archives widget to your sidebar and select &#8220;Sidebar&#8221; as the &#8220;Instance Name&#8221; in the widget form.</li>
<li> Finally, create a new page, call it &#8220;Archives&#8221; and add the shortcode &#91;PW_Archives name=&#8221;Full&#8221;&#93; in the content.</li>
</ol>
<p>Or suppose, for a different blog, you&#8217;ve registered two custom post types called &#8220;Books&#8221; and &#8220;Movies&#8221;, and you want to display the archives of both in your sidebar. Here&#8217;s how you&#8217;d do it:</p>
<ol>
<li>Create two PW_Archives instances, name one &#8220;Books&#8221; and the other &#8220;Movies&#8221;.</li>
<li>For the &#8220;Books&#8221; instance make sure to select only books (not posts) under &#8220;Include Types:&#8221; and only movies for the &#8220;Movies&#8221; instance.</li>
<li>Next, add two PW_Archives widgets to your sidebar and select &#8220;Books&#8221; for the &#8220;Instance Name&#8221; for one of them and &#8220;Movies&#8221; for the other.</li>
</ol>
<h3>Shortcode Usage</h3>
<p>Using PW_Archives with shortcode is as simple as just adding this to your post or page:</p>
<pre>&#91;PW_Archives&#93;</pre>
<p>When you use just the above code, the default PW_Archives settings will be used. To specify options, create an instance and pass the instance name like so:</p>
<pre>&#91;PW_Archives name="INSTANCE_NAME"&#93;</pre>
<h3>PHP Usage</h3>
<pre><code>&lt;?php PW_Archives(); ?&gt;</code></pre>
<p>Use the above code for the defaults and the below code to use a specific instance:</p>
<pre><code>&lt;?php PW_Archives( 'INSTANCE NAME' ); ?&gt;</code></pre>
<h2>Form Field Details</h2>
<h3>Settings</h3>
<dl>
<dt>Instance Name: </dt>
<dd>A name to represent this particular instance (configuration). This name is used to refer to these settings in widgets, shortcode, and php code.</dd>
<dt>Include Types: </dt>
<dd>A list of post types, including custom post types, to include in the archive query. More than one may be selected. </dd>
<dt>Archive Depth: </dt>
<dd>PW_Archives displays its archives as a hierarchy with years as the top level, months below that, and posts below months. If you only want to display years and month (not posts), select &#8220;Years &raquo; Months&#8221;. </dd>
<dt>Display Order: </dt>
<dd>The order in which to list the archives chronoglically. &#8220;Descending&#8221; means the most recent archives are listed first and &#8220;Ascending&#8221; means they&#8217;re listed last. </dd>
<dt>Years to Display: </dt>
<dd>Specify &#8216;All&#8217; to display all years that contain published posts. If you specify an integer, only that many of the most recent years will be displayed.</dd>
<dt>Initial Format: </dt>
<dd>How the archives are presented when the page initially loads. If you&#8217;ve indicated to hide certain submenus and javascript is disabled, those submenus are not loaded. If javascript is enabled, those menus are loaded but hidden. Keep this in mind if performance is a concern.</dd>
<h3>Javascript</h3>
</dl>
<dl>
<dt>Where:</dt>
<dd>Javascript can be enabled for year items, month items, or both. If you don&#8217;t want javascript enabled, leave both options unchecked. </dd>
<dt>Event Type:</dt>
<dd>&#8220;Click&#8221; refers to either a mouse click or a finger tap on a touch screen. &#8220;Hover&#8221; refers to when your mouse hovers over the item. </dd>
<dt>Animation Type:</dt>
<dd>&#8220;None&#8221; will cause the submenu to hide/show immediately. &#8220;Fade In/Out&#8221; will produce a nice fading animation, and &#8220;Slide Up/Down&#8221; will gradually reveal/cover the submenu from top to bottom or vise-versa.</dd>
<dt>Style:</dt>
<dd>Including PW_Archives&#8217; custom CSS will add extra visual icons that are instantly recognizable and synonymous with showing/hiding submenus. The icons are shown via the &#8220;list-style-image:&#8221; css property. </dd>
<h3>Year Format / Month Format / Post Format</h3>
</dl>
<dl>
<dt>Date </dt>
<dd>The date format string to use when displaying each item. See <a href="http://codex.wordpress.org/Formatting_Date_and_Time">Formatting Date and Time</a> for details.</dd>
<dt>Template:</dt>
<dd>The template for how individual items are listed.<br />
<code>%YEAR%</code> &#8211; The year based on the date format string specified<br />
<code>%YEAR_URL%</code> &#8211; The permalink to the archive page for this year. If custom post types are specified, they&#8217;re automatically added to the archive page.<br />
<code>%MONTH%</code> &#8211; The month based on the date format string specified<br />
<code>%MONTH_URL%</code> &#8211; The permalink to the archive page for this month. If custom post types are specified, they&#8217;re automatically added to  the archive page.<br />
<code>%POST_COUNT%</code> -The number of total published posts in this year/month<br />
<code>%POST_TITLE%</code> &#8211; The title of the post<br />
<code>%POST_DATE%</code> &#8211; The date this post was published outputted according to the date format string<br />
<code>%POST_URL%</code> &#8211; The permalink to this post<br />
<code>%POST_TYPE%</code> &#8211; The singular name of this post&#8217;s post type. This is often helpful to add a custom class to this item<br />
<code>%COMMENT COUNT%</code> &#8211; The number of comments for this post </dd>
</dl>
<h2>Questions / Feedback</h2>
<p>If you have any questions, feedback or suggestions, please leave a comment. I’m always looking to make my plugins better, and I don’t always know how people  are using them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2011/02/08/pw_archives/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Westmont Impact</title>
		<link>http://www.philipwalton.com/2010/09/01/westmont-impact/</link>
		<comments>http://www.philipwalton.com/2010/09/01/westmont-impact/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 16:00:38 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Yii Framework]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=41</guid>
		<description><![CDATA[At its core, Westmont Impact is a WordPress theme, but it&#8217;s a lot more than that. It&#8217;s also a secure donation application that takes credit cards and reports the real-time progress of the movement. But that&#8217;s not it, the site [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_42" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><a href="http://westmontimpact.org"><img class="size-full wp-image-42" title="Westmont Impact" src="http://philipwalton.com/wp-content/uploads/2011/02/westmont-impact.jpg" alt="Westmont Impact" width="640" height="360" /></a><figcaption class="screen-reader-text">Westmont Impact</figcaption></div></figure>
<p>At its core, Westmont Impact is a WordPress theme, but it&#8217;s a  lot more than that. It&#8217;s also a secure donation application that takes  credit cards and reports the real-time progress of the movement.</p>
<p>But that&#8217;s not it, the site also incorporates the Javascript  Facebook SDK to allow users to log in and see which of their Facebook  friends have also donated to the cause.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2010/09/01/westmont-impact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Mechanics Website Redesign</title>
		<link>http://www.philipwalton.com/2010/08/04/audio-mechanics-website-redesign/</link>
		<comments>http://www.philipwalton.com/2010/08/04/audio-mechanics-website-redesign/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 22:09:28 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=28</guid>
		<description><![CDATA[Audio Mechanics has quickly become one of the most sought-after re-mastering studios in Southern California. They have a reputation for aesthetic integrity and extreme technical proficiency. Specializations include sound restoration, music mastering, sound editing, and forensic audio. Their new facility [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_36" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><a href="http://audiomechanics.com"><img class="size-full wp-image-36" title="Audio Mechanics Site Redesign" src="http://philipwalton.com/wp-content/uploads/2010/08/audiomechanics.jpg" alt="Audio Mechanics Site Redesign" width="640" height="360" /></a><figcaption class="screen-reader-text">Audio Mechanics Site Redesign</figcaption></div></figure>
<p>Audio Mechanics has quickly become one of the most sought-after  re-mastering studios in Southern California. They have a reputation for  aesthetic integrity and extreme technical proficiency.  Specializations  include sound restoration, music mastering, sound editing, and forensic  audio.  Their new facility in Burbank, CA features state-of-the-art  adaptable 5.1 mastering rooms, a recording studio suitable for bands and  ADR work, and a stereo mastering control room.  Audio Mechanics has  maintained, through word-of-mouth, an impressive list of corporate and  independent clientele in the music, film, and television industries.</p>
<p>Audio Mechanics came to me in July of 2010 to have their site redesigned. Their one requirement: they wanted to be able to edit the content themselves.</p>
<p>Naturally, I recommended using WordPress. I offered to create a custom theme for them where every single  part of it — including all the menus, the images, and the slideshow — would be  editable. This was exciting for me because WordPress 3.0 had just come out and I was itching to try the new custom post types feature.</p>
<p>I created a custom post type called &#8220;SlideShowImage&#8221; so the client could just click &#8220;New SlideShowImage&#8221; (just like you&#8217;d click &#8220;New Post&#8221;), upload a photo of his choosing, give it a caption, and then the theme would automatically add it to the images in the slide show on the homepage.</p>
<p>Easy as pie. Go ahead, <a title="Audio Mechanics" href="http://audiomechanics.com">see it in action</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2010/08/04/audio-mechanics-website-redesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The &#8220;Bright Hope For Tomorrow&#8221; Campaign</title>
		<link>http://www.philipwalton.com/2010/03/23/the-bright-hope-for-tomorrow-campaign/</link>
		<comments>http://www.philipwalton.com/2010/03/23/the-bright-hope-for-tomorrow-campaign/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 01:34:13 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=45</guid>
		<description><![CDATA[Bright Hope for Tomorrow is the website for Westmont College&#8217;s capital campaign. The goal of the site was to make it extremely easy for visitors to simply tab through each of the pages and, very quickly, get a sense of [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_46" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><a href="http://westmont.edu/brighthope/"><img class="size-full wp-image-46" title="Bright Hope For Tomorrow Website" src="http://philipwalton.com/wp-content/uploads/2011/02/bright-hope.jpg" alt="Bright Hope For Tomorrow Website" width="640" height="360" /></a><figcaption class="screen-reader-text">Bright Hope For Tomorrow Website</figcaption></div></figure>
<p>Bright Hope for Tomorrow is the website for Westmont College&#8217;s  capital campaign. The goal of the site was to make it extremely easy for  visitors to simply tab through each of the pages and, very quickly, get  a sense of the compelling case for the campaign.</p>
<p>The site uses my custom flash video player as well as a sophisticated javascript history script to allow for the more natural  usage of the back and forward buttons despite the mostly javascript  interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2010/03/23/the-bright-hope-for-tomorrow-campaign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Westmont&#8217;s Website Showcased by Smashing Magazine</title>
		<link>http://www.philipwalton.com/2010/03/21/westmonts-website-shocased-by-smashing-magazine/</link>
		<comments>http://www.philipwalton.com/2010/03/21/westmonts-website-shocased-by-smashing-magazine/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 21:08:05 +0000</pubDate>
		<dc:creator>Philip Walton</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Smashing Magazine]]></category>

		<guid isPermaLink="false">http://philipwalton.com/?p=21</guid>
		<description><![CDATA[Getting approval of your work from other is great. But it&#8217;s especially great when that approval comes from a well-known and respected source and when it was completely unsolicited. Today a coworker forwarded me an article in Smashing Magazine called, [...]]]></description>
			<content:encoded><![CDATA[<figure id="attachment_38" class="wp-caption shadow alignnone" style="width: 640px"><div class="wp-caption-wrapper"><a href="http://westmont.edu"><img class="size-full wp-image-38 " title="Westmont Homepage Redesign" src="http://philipwalton.com/wp-content/uploads/2009/07/westmont.jpg" alt="Westmont Homepage Redesign" width="640" height="360" /></a><figcaption class="screen-reader-text">Westmont Homepage Redesign</figcaption></div></figure>
<p>Getting approval of your work from other is great. But it&#8217;s especially great when that approval comes from a well-known and respected source and when it was completely unsolicited.</p>
<p>Today a coworker forwarded me an article in <a href="http://www.smashingmagazine.com">Smashing Magazine</a> called, <a href="http://www.smashingmagazine.com/2010/03/19/showcase-of-academic-and-higher-education-websites/">Showcase of Academic and Higher Education Websites</a>. The article begins:</p>
<blockquote><p>College and university websites have a lot of roles to fill. They need to provide information for prospective students (both new and transfer), parents of students and prospective students, current students, and alumni. In many cases, they’re also the gateway to the school’s intranet and the public face for both academics and athletics. They often need to include reams of information in a way that makes everything easy to find. It’s a huge challenge.</p>
<p>And the truth is: most college and university websites are horribly designed. Either they look like they were designed fifteen years ago and then forgotten about, or they’re so overloaded with information that it’s almost impossible to find what you’re looking for.</p>
<p>But not every college or university website is horrible. There are some excellent sites out there, and below are some of them&#8230;</p></blockquote>
<p>And sure enough, Westmont&#8217;s homepage, which I had redesigned the previous summer, was among the websites listed. One of the comments they made about it was its &#8220;great color scheme&#8221;, which was particularly funny to me because I had gone through numerous revisions before eventually settling on the one I chose. Matching another color with maroon isn&#8217;t easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.philipwalton.com/2010/03/21/westmonts-website-shocased-by-smashing-magazine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

