<?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>Digging into WordPress &#187; Chris Coyier</title>
	<atom:link href="http://digwp.com/author/chriscoyier/feed/" rel="self" type="application/rss+xml" />
	<link>http://digwp.com</link>
	<description>Take your WordPress skills to the next level.</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:03:45 +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>Using &#8216;$&#8217; instead of &#8216;jQuery&#8217; in WordPress</title>
		<link>http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/</link>
		<comments>http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 18:57:29 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=5240</guid>
		<description><![CDATA[Writing out 'jQuery' a billion times in a script makes it harder to read and bloats its size. Let's stop doing that and start writing '$' like you see in the vast majority of jQuery code in the world.]]></description>
			<content:encoded><![CDATA[<p>WordPress ships with jQuery (for longevity&#8217;s sake, as I write this WordPress is v3.2.1). To use jQuery in your plugins and themes <a href="http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/">&#8220;The Right Way&#8221;</a> all you need to do is <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">enqueue it</a> (probably in your functions.php file):</p>
<pre><code>wp_enqueue_script("jquery");</code></pre>
<p>The tricky thing is this particular copy of jQuery is in <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries">compatibility mode</a> by default.<span id="more-5240"></span> That means that the typical &#8216;$&#8217; shortcut for jQuery doesn&#8217;t work, so it doesn&#8217;t conflict with any other JavaScript libraries that use the dollar sign also, like MooTools or Prototype. </p>
<p>Many plugin authors and theme developers are aware of this, and they use &#8216;jQuery&#8217; instead of &#8216;$&#8217; to be safe. </p>
<pre><code>/* Normal jQuery you see everywhere */
$("#some-element").yaddaYaddaYadda();

/* "Safe" jQuery you see in WordPress */
jQuery("#some-element").yaddaYaddaYadda();</code></pre>
<p><strong>Here&#8217;s the thing&#8230; writing out &#8216;jQuery&#8217; a billion times in a script makes it harder to read and bloats its size.</strong> Let&#8217;s stop doing that. </p>
<p>If the script is being loaded in the footer (which you should be doing in the vast majority of cases) you can wrap the code in an anonymous function (technically any <a href="http://benalman.com/news/2010/11/immediately-invoked-function-expression/">IIFE</a>) where you pass in jQuery to be mapped to $. </p>
<pre><code>(function($) {
	
	// $ Works! You can test it with next line if you like
	// console.log($);
	
})( jQuery );</code></pre>
<p>If you absolutely need to load the scripts in the header, you&#8217;ll probably need to use a document ready function anyway, so you can just pass in $ there.</p>
<pre><code>jQuery(document).ready(function( $ ) {
	
	// $ Works! You can test it with next line if you like
	// console.log($);
	
});</code></pre>
<p>Go forth and write nice looking jQuery!</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/">Permalink</a> | <a href="http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/#comments">9 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/&title=Using &#8216;$&#8217; instead of &#8216;jQuery&#8217; in WordPress">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/functions-php/" rel="tag">functions.php</a>, <a href="http://digwp.com/tag/jquery/" rel="tag">jquery</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>So really, don&#8217;t use just /%postname%/ as your permalink structure.</title>
		<link>http://digwp.com/2011/06/dont-use-postname/</link>
		<comments>http://digwp.com/2011/06/dont-use-postname/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 21:05:03 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4569</guid>
		<description><![CDATA[Update: This issue is FIXED in WordPress 3.3. Here&#8217;s the really short version: I used /%postname%/ as my permalink structure on CSS-Tricks for a long time. I have lots of Pages. My site went down. I changed my permalink structure to begin with a number. Now it&#8217;s fine. And the long version: All the sudden [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> This issue is FIXED in WordPress 3.3.</p>
<p><strong>Here&#8217;s the really short version:</strong> I used /%postname%/ as my permalink structure on <a href="http://css-tricks.com">CSS-Tricks</a> for a long time. I have lots of Pages. My site went down. I changed my permalink structure to begin with a number. Now it&#8217;s fine.</p>
<p><strong>And the long version:</strong></p>
<p>All the sudden one evening the server that runs this site and one of my other sites, CSS-Tricks seemed to get very slow (I noticed while trying to save a draft of a post). I tried visiting the homepage and various other parts of the site and it either took a long time or just timed out completely. Always a heart-sinking time for me, as I know very little about servers and how to troubleshoot them. <span id="more-4569"></span></p>
<p>When the server responded at all, serving up just the base document was by far the slowest thing:</p>
<p><img src="http://digwp.com/wp-content/uploads/slowresponse.png" alt="" title="slowresponse" width="570" height="310" class="alignnone size-full wp-image-4761" /></p>
<p>These sites are hosted on a <a href="http://mediatemple.net/">MediaTemple</a> (dv) server<sup>1</sup>. MediaTemple is known for responsive support and theoretically I&#8217;m on some kind of VIP program although I&#8217;m pretty sure I get the same level of support anybody else would. So of course I leaned on them for help. Even if the problem was outside of the scope of their support (likely since they don&#8217;t support the software you run, totally understandable) I thought if I pleaded hard enough they&#8217;d at least help me figure out the root cause.</p>
<p>I knew enough myself to look in Plesk (the server management software that runs on my server) in the Virtuozzo part where I can see &#8220;QoS Alerts&#8221; (Quality of Service). The biggest recurring issue was &#8220;kmemsize&#8221; (server memory), but pretty much everything was in the black.</p>
<p><img src="http://digwp.com/wp-content/uploads/qosalerts.png" alt="" title="qosalerts" width="570" height="264" class="alignnone size-full wp-image-4762" /></p>
<p>In the end, it was ultimately me who figured it out, but Media Temple was quite helpful in that I got to speak with someone on the phone who was clearly quite knowledgeable and helped watch the server as I tried different things confirming what was working and what was not.</p>
<h3>Diagnosing the problem</h3>
<p>I made a quick HTML-only test page on the server and hit that. Assuming the server wasn&#8217;t in a completely dead state, that would come back fairly quickly. Then I made PHP page that just echo&#8217;d something out. That came back even faster. So it&#8217;s not just purely Apache, or server load, or PHP. Then I made PHP page that ran a fairly intense MySQL query. That came back fairly quickly as well. So it wasn&#8217;t MySQL being overloaded either. Then I made a WordPress template where all it did was <code>get_header()</code>. That page took forever to serve up. So I proved that the problem was related to WordPress (something particular to my WordPress setup).</p>
<h3>The root of the problem</h3>
<p>Turns out it was the permalink structure set up in WordPress for CSS-Tricks that was the problem. From day one, about four years now, it&#8217;s been /%postname%/. I really like how short and readable the URL&#8217;s are in that structure. A URL like http://css-tricks.com/css-sprites/ is very clear about what that page is about, as well as great SEO for the search term &#8220;CSS Sprites&#8221;. But alas, having your post structure set up like that has serious performance implications.</p>
<p>I use <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> for caching, and it&#8217;s worked great for a long time. One of the things that it does is database caching. It displays the results at the end of the page in HTML comments. With the permalink structure set to /%postname%/, the comment on the end of the page looked like this:</p>
<p> <img src="http://digwp.com/wp-content/uploads/postnamequeries.png" alt="" title="postnamequeries" width="542" height="244" class="alignnone size-full wp-image-4763" /></p>
<p>Twenty five hundred queries on one page? That ain&#8217;t right. If I changed the permalink structure to something else, like one of the default options like /%year%/%monthnum%/%postname%/, then flushed the cache and checked what W3 Total Cache was saying, it was this:</p>
<p> <img src="http://digwp.com/wp-content/uploads/view-source_css-tricks.png" alt="" title="view-source_css-tricks" width="515" height="167" class="alignnone size-full wp-image-4764" /></p>
<p>Even that seems high but way more reasonable. </p>
<p>So, database queries? WTF? Why (or even does) WordPress need the database involved with permalink structures? Andrew Nacin, a WordPress core developer, was super helpful in all this. He told me that <a href="https://twitter.com/nacin/status/82236131072147456">queries aren&#8217;t the problem</a> and <a href="https://twitter.com/nacin/status/82239949293895680">urged me</a> to make that clear after publicly sharing these results. It really doesn&#8217;t make sense to me that the number of queries shoots way up under that permalink structure, but hey, I&#8217;m just reporting what I saw.</p>
<p>This is a very relevant part of <a href="http://codex.wordpress.org/Using_Permalinks">The Codex</a>:</p>
<blockquote><p>For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text &#8220;page slug&#8221; as the URL), and to compensate, <strong>WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties)</strong>. So, it is best to have at least two path segments in your post&#8217;s permalink structure such as /%year%/%postname%/ or even /posts/%postname%/.</p></blockquote>
<p><strong>Emphasis</strong> mine. </p>
<p>So why the number of queries increased so dramatically? No idea. Does WordPress use the database to resolve URLs when you use just /%postname%/? Yes. And if you use one of their recommendations, does it remove the need to interact with the database at all? I also don&#8217;t know, but it&#8217;s certainly faster.</p>
<p>How did I even think of permalinks as a potential problem? I&#8217;m not sure. I just wracked my brain trying to think of things it could be, and remembered that I&#8217;ve read things here and there over the years that this has been a problem. One of those articles was on <a href="http://ottopress.com/2010/category-in-permalinks-considered-harmful/">&#8220;Otto on WordPress&#8221;</a> which delves into this&#8230;</p>
<h3>Starting with a text-based part instead of a number-based part, that&#8217;s the problem.</h3>
<blockquote><p>The problem comes in when you try to use a non-number for the beginning of your permalink string.</p></blockquote>
<p>When WordPress is parsing the URL to figure out what to serve up, it really wants to figure out if it&#8217;s a post or a page. Pages always have the /%postname%/ structure. You can&#8217;t really change that. So if you use any one of the word-based permalink keywords (%category%, %tag%, %postname%, or %author%), which can theoretically be anything, WordPress can&#8217;t easily tell the difference between Posts and Pages. </p>
<p>Fairly obvious right? Your posts structure is /%postname%/ and your pages structure is /%postname%/ &#8211; if you publish one of each and call them both &#8220;Contact&#8221;, how does it tell them apart? Thankfully WordPress is smart enough to not let you choose the same slug for both, but it still proves problematic for URL parsing. </p>
<p>So if you&#8217;ve chosen to begin your URL structure with one of the text-based options, WordPress <a href="https://twitter.com/#!/nacin/status/82551983222964224">triggers a flag</a> called <strong>use_verbose_page_rules</strong> which literally <a href="https://twitter.com/#!/nacin/status/82248754593402880">creates a rule</a> for every single page that you have. So instead of a rather concise set of rewrite rules (maybe 10) now you have a very thick set of rewrite rules (10 + # of pages you have). I have 550 pages or so on CSS-Tricks, so this is clearly problematic. Andrew Nacin guesses performance issues seep in around <a href="https://twitter.com/nacin/status/82227583655223296">50-100 pages</a>. Not only do these new rewrite rules need to be read through on every single page request, the need to be recreated every time you create new content. Both very slow processes.</p>
<p>If you use anything numeric to start your permalink structure (or even a static word like &#8220;/posts/&#8221;), the rewrite rules can remain compact, and verbose rules do not need to be used. </p>
<p>Some might say, hey, just use the year or the year and month! That&#8217;s cool, go for it. I like that for the most part. Some people feel super strongly that having the date in the URL is vital since it gives people information about when the article was published. I don&#8217;t feel that strongly. I think that information is vital but it&#8217;s more important it&#8217;s visible on the page itself. SEO expert (not kidding, he&#8217;s the man) <a href="http://yoast.com/">Joost De Valk</a> told me dates in the URL&#8217;s can kill clickthrough rates on Search Engine Results Pages since the content can look old before they even see it. </p>
<p>Personally, I&#8217;ve opted to start my URL&#8217;s with /%post_id%/ then also use /%postname%/. It looks a little weird maybe, but I don&#8217;t overly mind it. Performance is more important to me.</p>
<h3>What can WordPress (the project) do?</h3>
<p>I&#8217;d vote that on the Settings page for permalinks, it should at least have a sentence like &#8220;It is not recommended that you begin your permalink structure with /%category%, %tag%, %postname%, or %author% for performance reasons.&#8221;</p>
<h3>What about me?! I use /%postname%/. What should I do?</h3>
<p>The thing to consider is how many pages you have now, and how many pages you might ever have. If you are pretty sure you&#8217;ll have very few, like under 20 pages EVER. Then whatever, I think you are probably fine with that structure. If you think you might have more than that, I think you ought to change now before it becomes a problem. Consider one of the date based structures or starting with the %post_id%.</p>
<h3>What about SEO?</h3>
<p>This one had me sweating. There are a lot of links out there to CSS-Tricks. I don&#8217;t want to lose traffic. That site is decent part of my income. Now all of those incoming links are wrong. That can&#8217;t be good for SEO!</p>
<p>Well as it turns out, it&#8217;s really not that big of a deal. There is a plugin out there that redirects all old posts to the new posts. <strong>Don&#8217;t use that!</strong> You don&#8217;t need it. WordPress automatically handles the 301 redirects from the old format to the new format. 301 redirects are what Google needs to know about your new format and update itself and retain your ranks. It&#8217;s been five days since my new transition, and even after a little snafu where I left it on a date-based structure while testing a little too long and Google picked it up, I&#8217;m right back where I was before and Google is showing my new structure just fine.</p>
<hr />
<p><sup>1</sup> <small>Media Temple (dv) Dedicated-Virtual 3.5 &#8211; Extreme w/ additional 256MB memory upgrade.</small></p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/06/dont-use-postname/">Permalink</a> | <a href="http://digwp.com/2011/06/dont-use-postname/#comments">157 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/06/dont-use-postname/&title=So really, don&#8217;t use just /%postname%/ as your permalink structure.">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/06/dont-use-postname/feed/</wfw:commentRss>
		<slash:comments>157</slash:comments>
		</item>
		<item>
		<title>Fun Edit Posts Link (✍)</title>
		<link>http://digwp.com/2011/06/fun-edit-posts-link/</link>
		<comments>http://digwp.com/2011/06/fun-edit-posts-link/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 21:46:55 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4747</guid>
		<description><![CDATA[Tiny little fun idea by Dave Rupert. Put this: &#60;?php edit_post_link('✍','',' '); ?&#62; before all your: &#60;?php the_title() ?&#62; So like: &#60;h1&#62;&#60;?php edit_post_link('✍','',' '); ?&#62; &#60;?php the_title() ?&#62;&#60;/h1&#62; And when logged in, if you have edit privileges for that post/page/whatever, you&#8217;ll see the titles like: ✍ How To Be Awesome Where the little icon is [...]]]></description>
			<content:encoded><![CDATA[<p>Tiny little fun idea <a href="https://twitter.com/davatron5000/status/83641289945526272">by Dave Rupert</a>. </p>
<p>Put this:</p>
<pre><code>&lt;?php edit_post_link('✍','',' '); ?&gt;</code></pre>
<p>before all your:</p>
<pre><code>&lt;?php the_title() ?&gt;</code></pre>
<p><span id="more-4747"></span></p>
<p>So like:</p>
<pre><code>&lt;h1&gt;&lt;?php edit_post_link('✍','',' '); ?&gt; &lt;?php the_title() ?&gt;&lt;/h1&gt;</code></pre>
<p>And when logged in, if you have edit privileges for that post/page/whatever, you&#8217;ll see the titles like:</p>
<h3>✍ How To Be Awesome</h3>
<p>Where the little icon is a clickable link to edit that page. Just gotta make sure your page is UTF-8, which I bet it already is.</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/06/fun-edit-posts-link/">Permalink</a> | <a href="http://digwp.com/2011/06/fun-edit-posts-link/#comments">13 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/06/fun-edit-posts-link/&title=Fun Edit Posts Link (✍)">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/06/fun-edit-posts-link/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>AnythingSlider Plugin</title>
		<link>http://wordpress.org/extend/plugins/anythingslider-for-wordpress/</link>
		<comments>http://digwp.com/2011/06/anythingslider-plugin/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 21:26:07 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4745</guid>
		<description><![CDATA[Jacob Dubail turned my AnythingSlider jQuery plugin (now maintained by a number of folks) into a WordPress plugin. It&#8217;s pretty neat. You create slides like you create posts, insert them with shortcodes, group them with categories, and control behavior and layout with simple backend user interface (rather than code). Direct Link to Article &#8212; Permalink [...]]]></description>
			<content:encoded><![CDATA[<p>Jacob Dubail turned my AnythingSlider jQuery plugin (now maintained by a number of folks) into a WordPress plugin. It&#8217;s pretty neat. You create slides like you create posts, insert them with shortcodes, group them with categories, and control behavior and layout with simple backend user interface (rather than code). </p>
<p><small><a href="http://wordpress.org/extend/plugins/anythingslider-for-wordpress/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2011/06/anythingslider-plugin/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/06/anythingslider-plugin/">Permalink</a> | <a href="http://digwp.com/2011/06/anythingslider-plugin/#comments">No comment</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/06/anythingslider-plugin/&title=AnythingSlider Plugin">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/06/anythingslider-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Your Own Functionality Plugin</title>
		<link>http://wpcandy.com/teaches/how-to-create-a-functionality-plugin</link>
		<comments>http://digwp.com/2011/05/create-your-own-functionality-plugin/#comments</comments>
		<pubDate>Thu, 12 May 2011 01:20:19 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4347</guid>
		<description><![CDATA[You have two choices when adding custom functionality to your WordPress site: your theme&#8217;s functions.php file, or a plugin. Ryan Imel reminds us that theme-specific functionality belongs in your functions.php file (like registering a sidebar) whereas site-specific functionality belongs in a plugin (like registering custom taxonomies), as well as teaches us how. Direct Link to [...]]]></description>
			<content:encoded><![CDATA[<p>You have two choices when adding custom functionality to your WordPress site: your theme&#8217;s functions.php file, or a plugin. Ryan Imel reminds us that theme-specific functionality belongs in your functions.php file (like registering a sidebar) whereas site-specific functionality belongs in a plugin (like registering custom taxonomies), as well as teaches us how.</p>
<p><small><a href="http://wpcandy.com/teaches/how-to-create-a-functionality-plugin" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2011/05/create-your-own-functionality-plugin/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/05/create-your-own-functionality-plugin/">Permalink</a> | <a href="http://digwp.com/2011/05/create-your-own-functionality-plugin/#comments">No comment</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/05/create-your-own-functionality-plugin/&title=Create Your Own Functionality Plugin">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/05/create-your-own-functionality-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphing Blog Comments Over Time</title>
		<link>http://digwp.com/2011/04/graphing-blog-comments-over-time/</link>
		<comments>http://digwp.com/2011/04/graphing-blog-comments-over-time/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 17:19:45 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4267</guid>
		<description><![CDATA[One of my other blocks, CSS-Tricks, has been around a number of years now. There are nearly 1,400 unique pages of content almost all of which have a comment thread. I had a feeling that in the last four years, despite fairly steady growth in traffic and subscribers, that the number of comments per post [...]]]></description>
			<content:encoded><![CDATA[<p>One of my other blocks, CSS-Tricks, has been around a number of years now. There are nearly 1,400 unique pages of content almost all of which have a comment thread. I had a feeling that in the last four years, despite fairly steady growth in traffic and subscribers, that the number of comments per post has dropped. But how to prove it? I don&#8217;t know of a way to easily see that data. </p>
<p>So I built a way to visualize the number of comments per post! I&#8217;m sure all you WordPress smarties have some better fancier way to do this, but this is how I did it. </p>
<p><strong>In a nutshell:</strong> write a <a href="http://codex.wordpress.org/Function_Reference/query_posts">custom query</a> to loop through all your posts and <a href="http://codex.wordpress.org/Template_Tags/get_comments_number">get the number of comments</a>. So combining those two things, I thought I&#8217;d just make a 1px wide element with a height relative to how many comments that post has.</p>
<p><span id="more-4267"></span></p>
<h3>Step 1: Figure out the maximum number of comments</h3>
<p>This will help us set the scale. The post with the maximum number of with have a line with 100% height, and it scales down from there. It&#8217;s easy to figure out the maximum number of comments <strong>after</strong> you looped through all the posts, but we actually need that information <strong>before</strong> we even start the loop so we can set the height during the loop.</p>
<p>Fortunately WordPress keeps the &#8220;comment_count&#8221; for each post in the the database. So we can write a query that will return the post with the most comments and then extract that number into a variable.</p>
<pre><code>$query = "SELECT comment_count FROM " . $wpdb-&gt;posts . " WHERE post_type = 'post' &amp;&amp; post_status = 'publish' ORDER BY comment_count DESC LIMIT 1";
$results = $wpdb-&gt;get_results($query);
$maxComments = $results[0]-&gt;comment_count;</code></pre>
<h3>Step 2: Loop through every single post</h3>
<p>All posts, from the first published to the latest published.</p>
<pre><code>query_posts('posts_per_page=-1&amp;order=ASC');

while (have_posts() ) : the_post();
  // output one line of graph
endwhile;</code></pre>
<h3>Step 3: Output a line for the graph</h3>
<p>Each line of the graph is going to be an anchor link, just so you can click it to go to that post should you wish. We&#8217;ll make those links <code>inline-block</code>, so we can set a <code>height</code> and <code>width</code>. This is the basics of the CSS:</p>
<pre><code>#chart { 
  padding: 100px 0; 
  height: 400px; 
  text-align: center; 
}
#chart &gt; a { 
  width: 1px;
  background: red;  
  vertical-align: bottom; 
  text-decoration: none;
}
#chart &gt; a:hover {
  background: black;
}</code></pre>
<p>Now within the loop, we&#8217;ll output those links (lines of the graph):</p>
<pre><code>$numComments = get_comments_number();
$heightPercentage = (($numComments / $maxComments) * 100);

echo "&lt;a href='";
echo get_permalink();
echo "' style='height: $heightPercentage%;'&gt;";
echo "&lt;span&gt;$numComments&lt;/span&gt;";
echo "&lt;/a&gt;";</code></pre>
<h3>Step 4: A little more&#8230;</h3>
<p>There are a couple more parts to this, like listing out the first and last year at the start and end of the chart (for context) and positioning the span with the number of comments at the top of the graph so you can view numbers on rollover.</p>
<p>I&#8217;m going to embed the code as a GitHub Gist here, so it&#8217;s easy to keep updated once all you smarties tell me all the stuff I&#8217;m doing wrong. This is built as a page template:</p>
<p><script src="https://gist.github.com/945619.js?file=gistfile1.php"></script></p>
<h3>The Graphs!</h3>
<p>Here&#8217;s the Google Analytics chart of CSS-Tricks since launch: </p>
<p><img src="http://digwp.com/wp-content/uploads/csstricksanalyticsgraph.png" alt="" title="csstricksanalyticsgraph" width="590" height="148" class="alignnone size-full wp-image-4269" /></p>
<p>And here&#8217;s the <a href="http://css-tricks.com/comment-graph/">comment graph</a> we just built:</p>
<p><img src="http://digwp.com/wp-content/uploads/csstricksgraph.png" alt="" title="csstricksgraph" width="590" height="188" class="alignnone size-full wp-image-4268" /></p>
<p>Kinda interesting. The charts definitely don&#8217;t follow each other like I would think they might. This isn&#8217;t enough data to infer why that is. You could say social media sites like Twitter have swallowed up some of comment activity. You could also say maybe the quality of the posts have gone down and inspire less comments. Who knows.</p>
<p>Here is <a href="http://digwp.com/comment-graph/">Digging Into WordPress&#8217;s graph</a>:</p>
<p><img src="http://digwp.com/wp-content/uploads/digwpgraph.png" alt="" title="digwpgraph" width="350" height="200" class="alignnone size-full wp-image-4273" /></p>
<h3>Share! Share!</h3>
<p>I&#8217;d love it, especially if you have a blog that&#8217;s been around a year or more, if you snagged this page template and linked up your own graph (or screenshot it) and posted it in the comments. </p>
<p>Maybe with a bunch of blogs graphs we could identify some trends. </p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/04/graphing-blog-comments-over-time/">Permalink</a> | <a href="http://digwp.com/2011/04/graphing-blog-comments-over-time/#comments">15 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/04/graphing-blog-comments-over-time/&title=Graphing Blog Comments Over Time">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/comments/" rel="tag">comments</a>, <a href="http://digwp.com/tag/graph/" rel="tag">graph</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/04/graphing-blog-comments-over-time/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>HTML5 Reset Theme</title>
		<link>http://html5reset.org/#wordpress</link>
		<comments>http://digwp.com/2011/04/html5-reset-theme/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 15:38:27 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4087</guid>
		<description><![CDATA[Version 2 of the HTML5 Reset by Tim Murtaugh and Michael Pick is out. This time it features a WordPress theme, which is based of Digging Into WordPress&#8217; own BLANK theme. I think we&#8217;ll retire BLANK and point to this more up-to-date theme. Direct Link to Article &#8212; Permalink on DiW © 2011 Digging into [...]]]></description>
			<content:encoded><![CDATA[<p>Version 2 of the HTML5 Reset by Tim Murtaugh and Michael Pick is out. This time it features a WordPress theme, which is based of Digging Into WordPress&#8217; own BLANK theme. I think we&#8217;ll retire BLANK and point to this more up-to-date theme.</p>
<p><small><a href="http://html5reset.org/#wordpress" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2011/04/html5-reset-theme/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/04/html5-reset-theme/">Permalink</a> | <a href="http://digwp.com/2011/04/html5-reset-theme/#comments">No comment</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/04/html5-reset-theme/&title=HTML5 Reset Theme">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/04/html5-reset-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The AWESOME Button</title>
		<link>http://blog.makezine.com/archive/2011/04/the-awesome-button.html</link>
		<comments>http://digwp.com/2011/04/the-awesome-button/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 22:08:34 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4072</guid>
		<description><![CDATA[Matt Richardson from MAKE magazine makes a USB device button, which when pressed, inserts an alternative word to &#8220;awesome&#8221;. He demonstrates its use inside the WordPress post editor =) Direct Link to Article &#8212; Permalink on DiW © 2011 Digging into WordPress &#124; Permalink &#124; No comment &#124; Add to del.icio.us &#124; Post tags:]]></description>
			<content:encoded><![CDATA[<p>Matt Richardson from MAKE magazine makes a USB device button, which when pressed, inserts an alternative word to &#8220;awesome&#8221;. He demonstrates its use inside the WordPress post editor =)</p>
<p><small><a href="http://blog.makezine.com/archive/2011/04/the-awesome-button.html" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2011/04/the-awesome-button/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/04/the-awesome-button/">Permalink</a> | <a href="http://digwp.com/2011/04/the-awesome-button/#comments">No comment</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/04/the-awesome-button/&title=The AWESOME Button">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/04/the-awesome-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What We Learned Publishing Digging Into WordPress</title>
		<link>http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/</link>
		<comments>http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 18:30:52 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1955</guid>
		<description><![CDATA[Digging into WordPress is an entirely self-published book. It&#8217;s not that way because we just arbitrarily decided that self publishing was hip and that was what we were going to do. In fact, the plan early on was the opposite. Step one, we thought, was to write the book. So we did that. Then step [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://digwp.com/book/">Digging into WordPress</a> is an entirely <strong>self-published book</strong>. It&#8217;s not that way because we just arbitrarily decided that self publishing was hip and that was what we were going to do. In fact, the plan early on was the opposite. Step one, we thought, was to write the book. So we did that. Then step two became <em>find publisher to publish it</em>, so <a href="http://css-tricks.com/looking-for-a-publisher/">we asked around</a>. We talked to five (or so) tech book publishers.</p>
<p>We learned in these talks with publishers that our Step One (write the book), is almost never Step One. Step One is actually get in contact with publishers and work with them from the beginning, from building out the Table of Contents outwards. We quickly learned that in working with any publisher, you gotta play by their rules. They have a process, that process works for them and the authors that choose to work with them. We were very green to this whole process, but we agreed that we didn&#8217;t want to work in the confines of someone else&#8217;s process. Call us stubborn, but we wanted to do whatever the heck we wanted with this book. And we had the tools to do it. Self publishing it was.</p>
<p><em>Here are some things we learned.</em><span id="more-1955"></span></p>
<h3>100% vs. 10%</h3>
<p><img src="/wp-content/blog-images/whatwelearned-scales.jpg" alt="" style="float:left;margin:5px 15px 5px 0;" /> Going through a publisher, we might have earned 10% of the sales of the books. Self publishing we earn 100% of the sales of the books. Going through a publisher means many of the costs are covered, like printing costs. Self publishing means paying those costs ourselves. Going through a publisher means they will help promote the book, and the book will be available in major book retail stores. Self publishing means all promotional work needs to be done by us and the book will only be available for purchase online. </p>
<p>These comparisons were the hardest to consider. Even today, since we have very little to compare against, we don&#8217;t know which route would have been more successful. However, I have a strong feeling that self publishing was the right move and ultimately made the project more successful. I also believe that this was only the case because Jeff and I had large enough built-in audiences to give the book some momentum. If we didn&#8217;t have that, I feel going through a publisher would have been a better choice.</p>
<p>Since the 100% vs. 10% was pretty close to a toss up (we did plenty of scratch-pad math) we decided that since we could do everything our own way by self publishing, we would go that route. Not to mention it would be fun and we would learn a lot doing it. </p>
<p class="takeaway"><strong>Takeaway:</strong> If you are confident you have a great book and have enough of an existing audience to give it some sales momentum, self publishing is the way to go.</p>
<h3>Should We Print At All?</h3>
<p><img src="/wp-content/blog-images/whatwelearned-print.jpg" alt="" class="learned-thumb" /> With the proliferation of digital book reading devices, it was a possibility to not make a paper version of the book at all. This would have been much easier from a distribution perspective. We also would have prevented any potential loss in case the book was a flop, since there would have been very little upfront cost other than our time and a few fonts we bought. And think of all the advantages to a digital book: searchable, copy-and-pasteable, easy to keep your place, links that are actually live and clickable, etc.</p>
<p>We decided that we were going to print (in addition to selling the PDF alone) for two strong reasons. 1) There are going to be some potential buyers that would only be interested in the print version and 2) It would be fun to have a real tangible product from our efforts.</p>
<p>We can now absolutely confirm that there is an audience that is only interested in print books. We have printed the book four times with three updates (another in the works), and whenever we sell out between printings we get plenty of email asking us when the print version will be available again. These same people aren&#8217;t just blowing smoke, they very often follow through on buying the book when it&#8217;s back in stock. </p>
<p>We made one more decision about selling print books: if you buy the print book you get the digital copy for &#8220;free.&#8221; Free in quotes, because of course money is changing hands, but there would be no price adjustment for it&#8217;s inclusion. It&#8217;s tempting to sell a book that comes both ways in three configurations: print book only, digital book only, and combo. The combo being the most expensive. I feel strongly that pricing the combo higher than the print-book-only is a douche move. It costs exactly nothing to send out a digital copy of a book. </p>
<p class="takeaway"><strong>Takeaway:</strong> Printing books is still worth it. Sell digital copies too. Digital should be free with print.</p>
<h3>Unique Printing Choices</h3>
<p><img src="/wp-content/blog-images/whatwelearned-spiral.jpg" alt="" class="learned-thumb" /> Because the printing choices were ours to make, we could do some cool things. First, we picked an unusual paper size, landscape, because we wanted big fat margins in which to insert notes and things in the book&#8217;s design. Second, we chose to spiral-bind the book instead of a traditional book bind. This would almost certainly never be allowed in a book headed to a bookstore, as there is no spine to identify it when placed normally on a bookshelf. Third, we made the book color-throughout. Only one publisher was receptive at all to this idea when we brought it up and they may have just been humoring us.</p>
<p>We haven&#8217;t gotten much feedback on the size or shape, although I personally feel I wouldn&#8217;t go as wide again, it&#8217;s a little unwieldily while open (would be very hard to read on a plane). People do really like the spiral bind though. It&#8217;s nice that gamble paid off.</p>
<p class="takeaway"><strong>Takeaway:</strong> Self publishing means print design freedom. Unique print design is good marketing.</p>
<h3>Pricing</h3>
<p><img src="/wp-content/blog-images/whatwelearned-price.jpg" alt="" class="learned-thumb" /> Pricing the PDF was a bit tough. It&#8217;s hard to price something where there are no physical production or delivery costs. For the PDF, our cost involves time spent working on the book and stuff like PayPal fees, E-junkie fees, software, fonts, domains, advertising, and other odds and ends. After looking at our expenses, we priced the PDF by coming in just a little cheaper than a <a href="http://rockablepress.com/books/rockstar-wordpress-designer/">comparable PDF</a>. Rockstar WordPress Designer is priced at $29 and our PDF is $27. We thought this sounded like a fair price. It&#8217;s not giving it away and it&#8217;s not overly expensive compared to other tech books.</p>
<p>Now we had a basis for figuring out the print copy prices. The per-book printing quote was quite high as expected. We had a lot working against us. We wanted full color. The page count was fairly high (averaging 400 pages). Our quantity was low (the more you print, the cheaper they are each). We wanted to sell out. Going too high on quantity with no experience means money tied up or lost in print sales.</p>
<p>The number we ultimately came up with was $67. It felt better than breaking the $70 level (although in later editions we had to come up to that). It still felt high, but still, some tech books are <a href="http://www.amazon.com/Signature-Programming-Techniques-Solutions-through/dp/1590595254/ref=sr_1_6_title_0_main?s=books&#038;ie=UTF8&#038;qid=1293998419&#038;sr=1-6">just damn expensive</a>. At this price point we made slightly less profit than selling a PDF, but comparable.</p>
<p>We simply had to come to terms with these pricing realities. The book was going to be expensive. It was, we decreed, only for the most serious of buyers.  And hey, everyone still gets all the great stuff other expensive tech books likely don&#8217;t give you: full color, &#8220;free&#8221; PDF, exclusive themes, lifetime updates, spiral bind, not to mention general quality.</p>
<p class="takeaway"><strong>Takeaway:</strong> Price based on your costs, the competition, and feeling. Above all, price to make money.</p>
<h3>Caught Up in Discount Codes</h3>
<p><img src="/wp-content/blog-images/whatwelearned-codes.jpg" alt="" class="learned-thumb" /> Every time we do any kind of promotion or sale, we see a rise in sales. I don&#8217;t think there is any doubt that discount promotions work. A common way to do that is to provide coupon/discount codes. We sell the book through E-Junkie which is a distribution/affiliate service that provides that functionality. </p>
<p>We made one-off discount codes for certain folks in certain scenarios. We made discount codes for other blogs when they wanted to do a review or giveaway for the book. We made discount codes for our own site. We made discount codes to be included in bundles. Sometimes Jeff would just sit back there and make up imaginary discount codes and then delete them for no reason.</p>
<p>This is what I would suggest to anyone selling a product where discount codes are involved. Pick your lowest level of discount code. Say 5%. Give away a unique discount code of this level to anyone who asks, be it a single person, organization, website, whatever. Set them to never expire. The information you get from how used these codes are is worth the 5%. If you ever make a code that is for more than that lowest level, make sure it expires and the person you give it to knows that so if they publicize it that information is present with it. </p>
<p>With a strategy like this, you can generously give away codes without having to think too hard about it or worry about them being abused in any way. </p>
<p class="takeaway"><strong>Takeaway:</strong> People will find and use the crap out of your discount codes, make sure to have a strategy.</p>
<h3>Editing Woes</h3>
<p><img src="/wp-content/blog-images/whatwelearned-errata.jpg" alt="" class="learned-thumb" /> The very first edition of this book was rife with errors. Only a few technical errors, but plenty of spelling, grammar, and formatting issues. Isn&#8217;t that what the editing process is for? It sure is. We didn&#8217;t skip that part either, it&#8217;s just that we didn&#8217;t take it seriously enough. We relied on friends, family, and ourselves to read through the book, catch errors, and provide notes. We are hugely grateful for their help, because without it, that first edition would have been much worse. </p>
<p>After the release, emails started coming in pointing out problems. These emails were responded to as promptly and nicely as possible. People that take the time to report problems are excellent customers and responding to their emails with the utmost respect will hopefully keep them that way. Thanks to all of the editing help we received from many generous people, the next update produced a much higher quality, more accurate book.</p>
<p>At first, we tried responding to errata emails as they rolled in &ndash; checking and fixing errors sort of on the spot. With everything else going on, we soon decided to automate and simplify the errata process as much as possible. Our errata system is now threefold: 1) setup an official <em>Errata &amp; Changelog</em> page to help streamline communique, 2) tag incoming errata email as such, and 3) check &amp; fix all errata at the same time, during book updates. This system helps to save time by keeping things streamlined, efficient, and thorough.</p>
<p>After putting up the <a href="http://digwp.com/book/errata/">Errata submission page</a>, we <a href="http://digwp.com/2009/11/find-typos-other-mistakes/">encouraged people to use it</a>. Later, when the print book came out, we gave folks that did the most work in finding errors free copies. </p>
<p>With each update, the accuracy of the book continues to improve. At first, we were inundated with editing woes, but I think we reacted well to the the situation and ended up with a solid book that continues to evolve. Looking back, we probably should have been more thorough with the initial editing process.</p>
<p class="takeaway"><strong>Takeaway:</strong> Pay for a real editor.</p>
<h3>Customer Support</h3>
<p><img src="/wp-content/blog-images/whatwelearned-support.jpg" alt="" class="learned-thumb"  /> When you sell a thing, you are pretty much required to do customer support. I can tell you I didn&#8217;t have any idea what we were getting into in this regard. People don&#8217;t get download emails. People wonder about shipping status. People wonder what the charge is on their credit card. People find a discount code after purchasing. We get a pretty darn healthy load of email. As we all know, email = work. You have to manage it well otherwise answering email turns into the only thing you do. </p>
<p>To handle email activity, we created a single and shared email address. We use the free Google Apps. We both have access to it and share in the responsibility of answering those emails. We label things and mark things for each other as needed. This system works exceptionally well for us.</p>
<p>One sometimes-not-so-obvious thing to help manage customer support is to find ways of streamlining the process. Take advantage of any tips or techniques that help you save time when dealing with your customers. Eliminate needless steps and bottlenecks. Do anything you can do to help the customer <em>more</em> while working <em>less</em>.</p>
<p>One specific way that we have improved response time involves using email templates for common inquiries. For example, we now have quick, copy/paste templates to respond quickly to requests for invoices, passwords, account updates, book updates, and so on. So when a customer asks, &#8220;can haz update?&#8221; &ndash; the answer is a speedy, &#8220;click, click, here, click.&#8221; Everybody is happy.</p>
<p>Another example of improving the customer experience is switching from a paid, third-party distribution program to our own home-grown system. Paying for PDF updates/distribution worked well at first, but the cost for sending out each new update is pretty high, so we eventually decided to move that part of the process to our own site. Now, instead of paying a hefty fee to send out update email links, we just upload the new version to the <a href="http://digwp.com/2010/11/new-updates-downloads-system/" title="Read about the new system">Members/Download Area</a> and let people grab current versions of the book and themes at their convenience.</p>
<p>And when it comes to shipping physical goods, using a shipping service that provides tracking is a <strong>must</strong>. Nothing beats the feeling of being able to tell worried customers the <em>exact</em> location of their merchandise.</p>
<p>Another one that is easy to forget: customer support is a great opportunity to make someone happy. They might not come to you that way, but if you help them out in a big way and fast, they can leave the experience an evangelist for you. </p>
<p class="takeaway"><strong>Takeaway:</strong> Share the load. React to what you get. Make customer support work for you.</p>
<h3>Affiliate Program Ups and Downs</h3>
<p><img src="/wp-content/blog-images/whatwelearned-affiliates.jpg" alt="" class="learned-thumb" /> E-Junkie provides an affiliate program for products you sell through them, which you can opt in to. This was a selling point, as when done properly, an affiliate program is a win-win for you as the seller and affiliates. We decided we&#8217;d give 50% of all PDF sales to the affiliate, which we thought would garner big interest in the program. And why not? There is a good chance the affiliate is reaching people that we could never reach on our own. And since the PDF costs less to produce or deliver, we&#8217;re still making money. When the print book came out, we adjusted the percentage so that the affiliate would earn the same ~$13 no matter which option someone chose, the print book or PDF. </p>
<p>One problem with our affiliate program is the way the links work. For the tracking to be done properly, the links that affiliates use go to <em>e-junkie.com</em> first, then are redirected to our website. That means that we get no SEO benefit from the links. If we took all the money that we paid out from the affiliate program and did things like send out more free books to &#8220;influential&#8221; folks perhaps we would have gotten more &#8220;natural&#8221; links and better SEO.  Would we have made as many sales? Who knows.</p>
<p>A much larger problem is abuse. In the last few months some very nasty affiliate program based fraud has popped up.  This is how it works: a bad guy has a bunch of stolen credit card information. They sign up for our affiliate program (which has no way to hold new affiliates until approved, they are just automatically approved). They click on their own links. They use fake information and the stolen credit card information to buy a PDF book from us. This earns that affiliate account the 50%. At the end of the month, unsuspecting affiliate program operators pay out all affiliates without cross referencing anything. </p>
<p>We are onto the scam now, but I&#8217;m not proud to say we paid out a number of months to these scumbags. Ultimately we have had to close the program until we can get time to switch a better system.</p>
<p class="takeaway"><strong>Takeaway</strong>: If you are aware of the risks and potential downsides and have a way to fight them, affiliate programs can be great.</p>
<h3>Homegrown Shipping</h3>
<p>Another thing to throw on the pile of self-publishing responsibilities is a shipping system. For every print book ordered you need to:</p>
<ol>
<li>Make sure you have a book (inventory control)</li>
<li>Box it up nicely so it protects the book well but don&#8217;t overdo the size and weight</li>
<li>Create a shipping label</li>
<li>Fill out international paperwork if necessary</li>
<li>Apply a return address</li>
<li>Take to shipping facility</li>
<li>Pay for shipping</li>
<li>Get tracking information to those who need/want it</li>
</ol>
<p>As well as&#8230;</p>
<ol start=9>
<li>Help customers with shipping issues</li>
<li>Don&#8217;t screw up and miss any</li>
</ol>
<p><img src="/wp-content/blog-images/whatwelearned-shipping.jpg" alt="" class="learned-thumb" /> This is a <strong>huge</strong> undertaking. Luckily we&#8217;ve had the help of both of our families in this endeavor. I think we can safely say more time has been put into this than the creation of the book itself. </p>
<p>The first few rounds of books we shipped via Media Mail. We were told this was the most cost effective possible way which seemed about right since each book came in I think under five bucks to anywhere in the United States. There were two problems with Media Mail: you can&#8217;t make those type of labels online and you also can&#8217;t get tracking information on them. We thought the good price was the most important thing, since the book was already so expensive. </p>
<p>As we should have known, price isn&#8217;t everything. Turns out choosing a different shipping option where we can create labels online and provide tracking information is far more valuable both for us and to customers. So that&#8217;s what we do now.</p>
<p>International shipping is another big issue. It&#8217;s just dang expensive to ship a book as a one-off overseas via any major shipping service. Our book, now priced at $70, is often over $100 when international shipping is applied. Also, we&#8217;ve had more issues of books not arriving (and some fraud) with international orders. At some points we&#8217;ve shut off international shipping. But now that we&#8217;ve got tracking (and insurance) going, it&#8217;s nice to be able to have it opened up, since there is certainly some demand for it. I also think, with the book already being so expensive, if you can afford that you can afford the shipping.</p>
<p>And what about profit? We don&#8217;t make anything from shipping. We have it adjusted just so in E-Junkie so that what we charge for shipping is pretty close to what we end up spending. It&#8217;s adjusted so that it&#8217;s ever so slightly higher so we don&#8217;t end up losing money, but like I said, it&#8217;s pretty close. I like that. It feels honest. I would feel shady if we tried to eek more profit out of a tack-on cost. </p>
<p class="takeaway"><strong>Takeaway:</strong> Shipping is one of the biggest time investments you&#8217;ll make self publishing a print book. Ship with tracking information, everybody wants it.</p>
<h3>Little ideas that worked out great</h3>
<p><strong>Short URLs</strong> &ndash; Using a good <a href="http://www.harleyquine.com/code/short-url-plugin/" title="WordPress Plugin">Short URL plugin</a> allowed us to use a short URL for all of the links in the book. This helps to keep book links consistent, easy to typeset, plus it also provides useful clickthrough information. Another bonus is that if the link on the other end went dead, we can redirect it somewhere else that&#8217;s actually useful instead of the user ending up somewhere useless.</p>
<p><strong>Book Index</strong> &ndash; Something that may save you time is skipping the book Index. We originally invested in some indexing software and put a bunch of time into building an index in the back of the book. As we continued to do updates, sometimes those updates would shift the page numbers around, which made keeping up the index ridiculously difficult. We ditched it. Nobody cared.</p>
<p><strong>Google Docs</strong> &ndash; It may not need mentioning, but Google Docs is another <em>extremely</em> useful collaboration tool that we used while writing the different chapters and putting things together. Rather than volley a swarm of emails back and forth, we set up a Google Docs account and later a Dropbox folder for transferring layout/design files. Taking advantage of these types of tools and services is a great way to collaborate on projects.</p>
<p><strong>Book Website</strong> &ndash; More than a &#8220;little&#8221; idea but worth mentioning somewhere in this post is the book&rsquo;s companion website, <a href="http://digwp.com/">DigWP.com</a>. Having some sort of online presence is must for <em>any</em> project, so for the book, we decided that a WordPress blog would be an awesome thing to do. We already post tons of WordPress stuff at our other sites, so having a dedicated place to keep it all focused turned out to be a great way to build context and add value to the book.</p>
<p><strong>Free Themes</strong> &ndash; People love free stuff. We love building WordPress themes. Turns out that giving away free WordPress themes at our <a href="http://themeclubhouse.digwp.com/" title="DigWP.com Theme Clubhouse">Theme Clubhouse</a> is another great way to add value to the book. We also have a growing collection of exclusive themes just for customers.</p>
<h3>Stop, Thief!</h3>
<p><img src="/wp-content/blog-images/whatwelearned-thief.jpg" alt="" class="learned-thumb" /> As we&#8217;ve all learned from the music industry, trying to prevent sharing and theft of digital files is nearly impossible. From the get-go we knew that. We did toy around with some theft-discouragement ideas though. E-Junkie has a PDF stamping feature where a downloaded copy would have the persons transaction ID on it, so if a file got lose on a sharing network we could look up who it was. Turns out that feature in E-Junkie doesn&#8217;t work very well (takes too long to generate the stamped PDF and the link is broken if people move through checkout at an average/fast pace). And besides, what would we do if we found someone who did that? Send them a mean email?</p>
<p>The PDF has been posted for download on sites of all kinds. We&#8217;ve done some fighting against those sites. We&#8217;ve won some. We&#8217;ve lost some. Nothing to lose any hair over. Plenty of honest people bought the book and continue to do so. </p>
<p>We have one really excellent fighting technique and that&#8217;s the fact that we offer free updates to the book and its support materials to legitimate purchases. Thieves obviously don&#8217;t get this courtesy. And the more times we do it, the harder it is to find the most current version online to steal. </p>
<p class="takeaway"><strong>Takeaway:</strong> Theft happens. Better to spend time on the positive tasks of creating than the negative tasks of fighting. There are more creative ways to encourage purchases.</p>
<h3>Working with a Co-Author</h3>
<p>Holy crap we&#8217;ve covered a lot of ground haven&#8217;t we? Has it struck you how much work all this has been? Thankfully there are two of us working on this. I&#8217;m 100% certain that the book is better than twice as good because there were two of us. We sold more than twice as many as either of us alone could have sold. We&#8217;ve only gone half as crazy as we would have otherwise. </p>
<p class="takeaway"><strong>Takeaway:</strong> Co-authors rock.</p>
<h3>That&#8217;s all, folks</h3>
<p>If you have any other specific questions about self publishing, let us know in the comments.</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/">Permalink</a> | <a href="http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/#comments">33 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/&title=What We Learned Publishing Digging Into WordPress">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/book/" rel="tag">book</a>, <a href="http://digwp.com/tag/diy/" rel="tag">DIY</a>, <a href="http://digwp.com/tag/printing/" rel="tag">printing</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/03/what-we-learned-publishing-digging-into-wordpress/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Roger Johansson on WordPress</title>
		<link>http://www.456bereastreet.com/archive/categories/wordpress/</link>
		<comments>http://digwp.com/2011/02/roger-johansson-on-wordpress/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 18:29:23 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=3647</guid>
		<description><![CDATA[He&#8217;s posted a bunch of good, specific, detailed articles on WordPress lately on 456 Berea St. Worth checking out. Direct Link to Article &#8212; Permalink on DiW © 2011 Digging into WordPress &#124; Permalink &#124; No comment &#124; Add to del.icio.us &#124; Post tags:]]></description>
			<content:encoded><![CDATA[<p>He&#8217;s posted a bunch of good, specific, detailed articles on WordPress lately on 456 Berea St. Worth checking out. </p>
<p><small><a href="http://www.456bereastreet.com/archive/categories/wordpress/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2011/02/roger-johansson-on-wordpress/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/02/roger-johansson-on-wordpress/">Permalink</a> | <a href="http://digwp.com/2011/02/roger-johansson-on-wordpress/#comments">No comment</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/02/roger-johansson-on-wordpress/&title=Roger Johansson on WordPress">del.icio.us</a> | Post tags: <br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/02/roger-johansson-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

