<?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>Lee Willis &#187; Lee Willis</title> <atom:link href="http://www.leewillis.co.uk/tag/design/feed/" rel="self" type="application/rss+xml" /><link>http://www.leewillis.co.uk</link> <description></description> <lastBuildDate>Sun, 22 Jan 2012 21:23:57 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>WordPress Photoblog Theme</title><link>http://www.leewillis.co.uk/wordpress-photoblog-theme/</link> <comments>http://www.leewillis.co.uk/wordpress-photoblog-theme/#comments</comments> <pubDate>Mon, 18 Oct 2010 21:28:16 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[design]]></category> <category><![CDATA[e-commerce]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP E-Commerce]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=308</guid> <description><![CDATA[I recently built a site for a friend (The excellent photographer Stewart Smith). The site uses a rather heavily customised version of WP e-Commerce for the e-Commerce aspects, but I&#8217;m also releasing the core WordPress photo blogging theme as a &#8230; <a
href="http://www.leewillis.co.uk/wordpress-photoblog-theme/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/10/theme_overview.png" rel="lightbox[308]"><img
class="contentimgleft" title="WordPress Photo Blogging Theme" src="http://www.leewillis.co.uk/wp-content/uploads/2010/10/theme_overview-300x300.png" alt="WordPress Photo Blogging Theme" width="300" height="300" /></a>I recently built a site for a friend (The excellent <a
href="http://www.stewartsmithphotography.co.uk/" target="_blank">photographer Stewart Smith</a>). The site uses a rather heavily customised version of <a
href="http://getshopped.org/" target="_blank">WP e-Commerce</a> for the e-Commerce aspects, but I&#8217;m also releasing the core <a
href="http://photographyparadise.leewillis.co.uk/">WordPress photo blogging theme</a> as a stand-alone release as I think the approach is pretty different from most of the photo blog themes out there.</p><p>I&#8217;m pretty happy with the theme in action on Stewart&#8217;s site, but I realise that people do strange and interesting things on their WordPress sites, so before I release the theme, I&#8217;m looking for people to test and provide feedback.</p><p>Interested? Check it out <a
href="http://photographyparadise.leewillis.co.uk/">here</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/wordpress-photoblog-theme/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Why Custom Post Type theming is broken in WordPress</title><link>http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/</link> <comments>http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/#comments</comments> <pubDate>Tue, 14 Sep 2010 06:30:34 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[Custom Post Types]]></category> <category><![CDATA[Custom Taxonomies]]></category> <category><![CDATA[design]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=292</guid> <description><![CDATA[I&#8217;m not normally a fan of sensationalist headlines, but in this case I know a bunch of people have put a bunch of effort into trying to make something work &#8220;The Right Way&#8221;[TM] only to discover that the right way &#8230; <a
href="http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;m not normally a fan of sensationalist headlines, but in this case I know a bunch of people have put a bunch of effort into trying to make something work &#8220;The Right Way&#8221;<sup>[TM]</sup> only to discover that the right way doesn&#8217;t actually work.</p><p>It&#8217;s<strong> even worse</strong> than that, because the same issue also affects Custom Taxonomies.</p><p>Now, much has <a
href="http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28">been</a> <a
href="http://www.1stwebdesigner.com/wordpress/essential-guide-wordpress-custom-taxonomies/">made</a> of <a
href="http://codex.wordpress.org/Custom_Taxonomies">Custom Taxonomies</a>, <a
href="http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/">and</a> <a
href="http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress">of</a> <a
href="http://codex.wordpress.org/Custom_Post_Types">Custom Post Types</a>, and rightly so. Custom Post Types and Custom Taxonomies are great facilities that really start to move WordPress away from a blogging tool, and into the realms of a a CMS and application development framework.</p><p>I&#8217;m a big fan of Custom Taxonomies, and I&#8217;ve <a
href="http://www.leewillis.co.uk/wordpress-taxonomies-to-create-a-product-directory/">written about what you can do with them</a> before, and I&#8217;ve used them in anger on real WordPress sites. Custom Post Types are a little newer, and I&#8217;ve only just started working with them.</p><p>So &#8211; why the outrageous statement about them being broken?</p><p>Well, the good news is that I don&#8217;t think Custom Taxonomies, and Custom Post Types themselves are broken &#8211; what is broken is the theme support that goes with them.</p><h2>Anatomy of a WordPress theme</h2><p>To explain this in detail, you first have to understand a little about how WordPress themes work. Themes in WordPress consist of a number of files, which will be used according to <a
href="http://codex.wordpress.org/Template_Hierarchy#The_Template_File_Hierarchy">the template hierarchy</a>. That is, if WordPress is trying to display the home page it will look for home.php. If it&#8217;s found in the users theme (or child theme) then it will be used to display the page. If WordPress is displaying a single post then it will look for single.php and use that to display the page.</p><p>The important thing to note is that each of these pages, whether it&#8217;s home.php, single.php, archive.php or page.php is responsible for the whole of the page. Let&#8217;s consider an example of a web page layout from a typical website:</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-1.png" rel="lightbox[292]"><img
class="aligncenter size-medium wp-image-301" title="ecommerce-sample-1" src="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-1-223x300.png" alt="" width="223" height="300" /></a></p><p>Breaking this down, there are the following main areas:</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-2.png" rel="lightbox[292]"><img
class="contentimgleft size-medium wp-image-302" title="ecommerce-sample-2" src="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-2-223x300.png" alt="" width="223" height="300" /></a> In this example, the page is made up of a site header (Yellow), some sidebars (Green) and a site footer (Blue). The main article/archive is contained in the white section. This is a fairly typical layout. If you were building this in WordPress, a fairly common approach would be to call get_header() at the top of all of your template files, get_sidebar() after that, then have the code to display the page content, and finally a call to get_footer().</p><p>get_header(), get_sidebar() and get_footer() are really just convenience functions that include specific theme files, making it easy to have standard headers, footers, sidebars etc. across your whole site.</p><p>So, this leaves us with this:</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-3.png" rel="lightbox[292]"></a><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-3.png" rel="lightbox[292]"><img
class="aligncenter size-medium wp-image-303" title="ecommerce-sample-3" src="http://www.leewillis.co.uk/wp-content/uploads/2010/09/ecommerce-sample-3-223x300.png" alt="" width="223" height="300" /></a></p><h2>Custom Post Type Theming</h2><p>So &#8211; what&#8217;s all this got to do with Custom Post Type theming then? Well, those of you paying attention will have realised that the Template Hierarchy provides support for theming both the display of single posts of a custom post type (Via single-{post_type}.php) and archives of posts belonging to a custom taxonomy (Via taxonomy_{taxonomy}.php or taxonomy_{term}.php).</p><p>On the face of it, this all seems fine. If you&#8217;re building a site, then you write a small chunk of code to register your custom post type, maybe add some meta boxes to the admin page to capture information specific to your post type, then throw together a template page to display it all.</p><p>Let&#8217;s take a custom post type of &#8220;Movie&#8221; as an example. We&#8217;d register it, set it up, and probably add some additional information beyond just the main content, particularly we might associate the post-type with the &#8220;Director&#8221;, and &#8220;Actor&#8221; taxonomy. This would allow us to show information about the director, and actors involved in the film on the &#8220;Single Movie&#8221; view &#8211; as well as create taxonomy archives by Director, or Actor.We might also add a meta-box to capture the movie running time, and maybe a review score (&#8220;9/10&#8243; etc.)</p><p>So, we wander off to our theme, copy single.php to single-movie.php and add in some code to fetch the taxonomy information, and display it where we want, and also to fetch and display the running time, and review score.</p><p>Job done.</p><h2>The Problem</h2><p>What if you&#8217;re writing a plugin that implements the movie Custom Post Type? Your end-user&#8217;s theme won&#8217;t have a single-movie.php file &#8211; so WordPress will fall back to using single.php &#8211; which of course won&#8217;t pull back the Director, Actor, Running Time and Review information. So what do you do?</p><p>The obvious thing is to supply a single-movie.php that the user can use. Now rewind a little, to where I said that theme files were &#8220;responsible for the whole of the page&#8221;.</p><p>This is where we hit our problem. We can assume that our single-movie.php should call get_header(), get_sidebar(), display our custom post type data, and then call get_footer().</p><p>But what about people who have a right-hand sidebar? What if the users theme has a bunch of standard page-furniture that isn&#8217;t included in header.php or footer.php, but included in each of the various single.php, archive.php?</p><p>Now we start to see the problem. It&#8217;s virtually impossible to distribute code that registers a custom post type, and be able to use the Template Hierarchy to display it &#8211; your only real option is to let WordPress fall back to single.php and then filter the_content, and then build your own &#8220;theme&#8221; infrastructure to let users &#8220;theme&#8221; the content.</p><p>This is bad because it&#8217;s reinventing the wheel, bad because it makes it difficult for theme authors to provide support for your cool plugin out-of-the-box, and bad because it&#8217;s unintuitive.</p><p>The same problem exists for taxonomy_{taxonomy}.php as well so you can&#8217;t create nice taxonomy views for the taxonomies your plugin creates.</p><p>Ideally, we want to be able to provide a template that is <strong>just</strong> responsible for displaying the post itself, (ie the white box only in the images above), and have the rest of the page displayed by other files in the user&#8217;s theme.</p><p>How we get there is beyond me though &#8230; answers welcome below!</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/feed/</wfw:commentRss> <slash:comments>62</slash:comments> </item> <item><title>Getting URL of Post Thumbnails in WordPress 2.9</title><link>http://www.leewillis.co.uk/getting-url-post-thumbnails-wordpress/</link> <comments>http://www.leewillis.co.uk/getting-url-post-thumbnails-wordpress/#comments</comments> <pubDate>Fri, 29 Jan 2010 22:25:59 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[design]]></category> <category><![CDATA[hacks]]></category> <category><![CDATA[hints]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=197</guid> <description><![CDATA[One of the improvements in WordPress 2.9 is native support for thumbnail images on posts. The API is pretty good &#8211; although it assumes that you want to return the whole IMG tag. In my case I wanted to return &#8230; <a
href="http://www.leewillis.co.uk/getting-url-post-thumbnails-wordpress/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>One of the improvements in WordPress 2.9 is native support for thumbnail images on posts. The API is pretty good &#8211; although it assumes that you want to return the whole IMG tag. In my case I wanted to return the URL of the image (So I could wrap the actual thumbnail in a lightbox-style link to the larger versions).</p><p>So &#8211; if you want to get the URL of your posts thumbnail &#8211; here&#8217;s the code you need:</p><pre name="code" class="php:nogutter:nocontrols">$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large');
$image_url = $image_url[0];</pre><p>I hope this helps you with your theme development.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/getting-url-post-thumbnails-wordpress/feed/</wfw:commentRss> <slash:comments>39</slash:comments> </item> <item><title>How to Split Test WordPress Themes</title><link>http://www.leewillis.co.uk/how-to-split-test-wordpress-themes/</link> <comments>http://www.leewillis.co.uk/how-to-split-test-wordpress-themes/#comments</comments> <pubDate>Sat, 17 Oct 2009 09:38:37 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[design]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=162</guid> <description><![CDATA[I recently re-worked a site for a client. He was moving over from Joomla to WordPress, so I started from scratch with his theme design. They liked the new theme I came up with &#8211; however I&#8217;d put the menu &#8230; <a
href="http://www.leewillis.co.uk/how-to-split-test-wordpress-themes/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I recently re-worked a site for a client. He was moving over from Joomla to WordPress, so I started from scratch with his theme design. They liked the new theme I came up with &#8211; however I&#8217;d put the menu and other navigation (Links to recent articles, etc) in a right hand sidebar, and they weren&#8217;t too sure about that.</p><blockquote><p>&#8220;Doesn&#8217;t everyone have the menu on the left?&#8221;</p></blockquote><p>Now I&#8217;m no usability expert, and while I figured they were probably right I thought we&#8217;d run a little experiment. I trawled around a bit, and I found a nice <a
href="http://www.dellanave.com/blog/2009/07/15/how-to-split-test-your-wordpress-theme-w-plugin/" target="_blank">little post</a> by David Dellanave. While I was OK implementing David&#8217;s solution I though it was probably a little complicated for some of my other clients, especially when it came to running 3 <a
href="http://www.google.com/analytics/" target="_blank">Google analytics</a> accounts &#8211; so I did some digging.</p><p>The result is the SES <a
href="http://wordpress.org/extend/plugins/wordpress-ab-theme-split-tests/" target="_new">Split Testing plugin</a>.</p><p>To use the plugin you&#8217;ll need to be using Google Analytics tracking on your WordPress blog already (If you&#8217;re not, then I&#8217;d recommend the &#8220;<a
href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/" target="_blank">Google Analytics for WordPress</a>&#8221; plugin), then :</p><ul><li>Create two (or more) versions of your theme</li><li>Select them in the plugin settings</li><li>Define custom segments in Google Analytics</li><li>Sit back and watch the results roll in</li></ul><h4>Create theme variations</h4><p>In most cases, you&#8217;ll want to test two versions of 1 theme with some slight changes. Let&#8217;s assume your theme is in the folder wp-content/themes/mytheme. Take a copy of your theme and put it in fresh folder, e.g. wp-content/themes/mytheme_2. Open up the style.css file in the second folder, and change the Theme Name, e.g.</p><pre class="css:nogutter:nocontrols">/*
Theme Name: MyTheme
*/</pre><p>to</p><pre class="css:nogutter:nocontrols">/*
Theme Name: MyTheme (v2)
*/</pre><h3>Set up plugin settings</h3><p><a
rel="lightbox" href="http://www.leewillis.co.uk/wp-content/uploads/2009/10/sesthemesplittest.png"><img
class="contentimgright size-thumbnail " title="Wordpress Theme Split Testing" src="http://www.leewillis.co.uk/wp-content/uploads/2009/10/sesthemesplittest-150x137.png" alt="Wordpress Theme Split Testing" width="150" height="137" /></a>Now you can drop <a
href="http://www.leewillis.co.uk/patches/wp_splittest/ses_splittest.php">the plugin </a>into your plugin directory, activate it in the WordPress backend, and then go to the settings page (Settings-&gt;SES Theme Split Test). The plugin will list all of your available themes, and you can choose which ones you want to be part of the test.</p><p>Once you&#8217;ve saved the settings, the split testing will kick in. Visitors will be randomly assigned one of the chosen themes, and they&#8217;ll receive that theme any time they visit in the next 30 days. Not only that, but their visit will be tagged with a special variable that you can pick up on in Google Analytics.</p><h3>Set up Custom Analytics Segments</h3><p>Google Analytics lets you define custom segments (Ways of grouping customers). In this example we want to group customers according to which theme they were shown and then we can measure our chosen metric (Purchase / sign-up / page views &#8211; whatever) for the two groups and compare them. To get started, you probably want to wait 24 hours so that Google starts to receive the tagging data.</p><p><a
rel="lightbox" href="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_1.png"><img
class="contentimgright size-thumbnail wp-image-170" title="Setting up custom segments" src="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_1-150x74.png" alt="Setting up custom segments" width="150" height="74" /></a>Log into your analytics account, and click on the &#8220;All Visits&#8221; dropdown (Top-right, just above the date selector), and then choose &#8220;Create a new advanced segment&#8221;. Then, you want to expand the &#8220;Visitors&#8221; dropdown under &#8220;Dimensions&#8221;</p><p><a
rel="lightbox" href="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_2.png"><img
class="contentimg aligncenter size-medium wp-image-174" title="Custom Segment Build" src="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_2-300x171.png" alt="Custom Segment Build" width="300" height="171" /></a></p><p>Scroll down until you find &#8220;User Defined Value&#8221; and drag it onto the right hand box that says &#8220;dimension or metric&#8221;. If Analytics has got your tagging data (See &#8211; I told you to leave it 24 hours!) then you&#8217;ll get to choose from the values being passed, e.g.</p><p><a
rel="lightbox" href="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_3.png"><img
class="contentimg aligncenter size-medium wp-image-176" title="Analytics Custom Segments" src="http://www.leewillis.co.uk/wp-content/uploads/2009/10/segments_3-300x199.png" alt="Analytics Custom Segments" width="300" height="199" /></a></p><p>Create a segment for each of your themes, and give them a meaningful name, then you&#8217;ll be able to select them as custom segments in your reports.</p><p><a
rel="lightbox" href="http://www.leewillis.co.uk/wp-content/uploads/2009/10/finalreports.png"><img
class="contentimg aligncenter size-medium wp-image-177" title="Segmented Analytics Reports" src="http://www.leewillis.co.uk/wp-content/uploads/2009/10/finalreports-300x156.png" alt="Segmented Analytics Reports" width="300" height="156" /></a></p><p>Now it&#8217;s just time to wait, see what happens, then decide. Once you&#8217;ve got a winner then just set that as your blog&#8217;s standard theme in the normal way, and either deactivate the plugin, or unselect the themes in the settings and users will see the blog default.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/how-to-split-test-wordpress-themes/feed/</wfw:commentRss> <slash:comments>103</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: www.leewillis.co.uk @ 2012-02-04 18:56:03 -->
