<?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>leewillis.co.uk&#187; Lee Willis</title> <atom:link href="http://www.leewillis.co.uk/tag/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://www.leewillis.co.uk</link> <description>Building a business on Open Source</description> <lastBuildDate>Thu, 26 Aug 2010 19:20:39 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Post Thumbnails only for Custom Post Types</title><link>http://www.leewillis.co.uk/post-thumbnails-custom-post-types/</link> <comments>http://www.leewillis.co.uk/post-thumbnails-custom-post-types/#comments</comments> <pubDate>Thu, 26 Aug 2010 19:19:32 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[e-commerce]]></category> <category><![CDATA[hints]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[WP E-Commerce]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=287</guid> <description><![CDATA[The guys over at getshopped.org are working on a pretty major revision to their WP e-Commerce plugin. Part of this is migrating &#8220;products&#8221; into custom post types, including using post thumbnails for the product images. One of the problems that has cropped up in testing was where user&#8217;s themes didn&#8217;t support post thumbnails. The first [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fpost-thumbnails-custom-post-types%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fpost-thumbnails-custom-post-types%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>The guys over at <a
href="http://getshopped.org">getshopped.org</a> are working on a pretty major revision to their WP e-Commerce plugin. Part of this is migrating &#8220;products&#8221; into custom post types, including using post thumbnails for the product images. One of the problems that has cropped up in testing was where user&#8217;s themes didn&#8217;t support post thumbnails. The first fix for was for the plugin to force &#8220;theme support&#8221; for post thumbnails by calling</p><pre name="code" class="php:nogutter:nocontrols">add_theme_support( 'post-thumbnails' );</pre><p>This worked, in that it solved the problem &#8211; all of the post-thumbnail function calls worked. However, it left a bug, and one that isn&#8217;t a software, or a techie bug &#8211; it was the worst kind &#8211; a bad user experience. Suddenly &#8220;posts&#8221; and &#8220;pages&#8221; would allow you to set featured images when authoring, or editing, but because the theme didn&#8217;t really support post thumbnails, those images would never show leaving a confused, bewildered user. So, the solution is to enable the support in general, but disable it for specific post types:</p><pre name="code" class="php:nogutter:nocontrols">function check_thumbnail_support() {
 if (!current_theme_supports('post-thumbnails')) {
   add_theme_support( 'post-thumbnails' );
   add_action('init','remove_posttype_thumbnail_support');
 }
}
add_action('after_setup_theme','check_thumbnail_support',99);

function remove_posttype_thumbnail_support() {
 remove_post_type_support('post','thumbnail');
 remove_post_type_support('page','thumbnail');
}
</pre><p>This does three important things:<br
/> 1. Check to see if the theme supports thumbnails already &#8211; if so, do nothing<br
/> 2. If not, then turn on post thumbnail support, but also &#8230;<br
/> 3. Remove support from &#8220;post&#8221; and &#8220;page&#8221;</p><p>The &#8220;gotcha&#8221; if you&#8217;re trying to come up with this yourself is that theme support is for &#8220;post-thumbnails&#8221;, but post_type_support is for the more generic &#8220;thumbnails&#8221;. Hope this comes in handy some someone.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/post-thumbnails-custom-post-types/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>WordCamp UK 2010</title><link>http://www.leewillis.co.uk/wordcamp-uk-2010/</link> <comments>http://www.leewillis.co.uk/wordcamp-uk-2010/#comments</comments> <pubDate>Wed, 23 Jun 2010 21:41:35 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[WP E-Commerce]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=285</guid> <description><![CDATA[WordCamp UK is an informal annual gathering of WordPress publishers, designers and developers based in the United Kingdom. This year&#8217;s event is being held in Manchester (Which is nice and central if you ask me!) and looks like it&#8217;ll be a great chance to chat about what&#8217;s new and groovy with WordPress, and find out [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwordcamp-uk-2010%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwordcamp-uk-2010%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p><a
href="http://2010.wordcampuk.org/">WordCamp UK</a> is an informal annual gathering of WordPress publishers, designers and  developers based in the United Kingdom.</p><p>This year&#8217;s event is being held in Manchester (Which is nice and central if you ask me!) and looks like it&#8217;ll be a great chance to chat about what&#8217;s new and groovy with WordPress, and find out who&#8217;s doing what in the UK.</p><p>You can find out more at the <a
href="http://2010.wordcampuk.org/about/" target="_blank">WordCamp UK</a> site.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/wordcamp-uk-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Reverse the product order in WP e-Commerce</title><link>http://www.leewillis.co.uk/reverse-the-product-order-in-wp-e-commerce/</link> <comments>http://www.leewillis.co.uk/reverse-the-product-order-in-wp-e-commerce/#comments</comments> <pubDate>Wed, 09 Jun 2010 20:27:30 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[e-commerce]]></category> <category><![CDATA[hints]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[WP E-Commerce]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=272</guid> <description><![CDATA[While WP e-Commerce lets you choose how to order your products (E.g. Price, Name, Date Uploaded) through the admin area, it doesn&#8217;t let you control whether you&#8217;re sorting ascending or descending &#8211; e.g. cheapest first, or most expensive first. Here&#8217;s a a quick tip to show how to control the sort order, just add the [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Freverse-the-product-order-in-wp-e-commerce%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Freverse-the-product-order-in-wp-e-commerce%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>While WP e-Commerce lets you choose how to order your products (E.g. Price, Name, Date Uploaded) through the admin area, it doesn&#8217;t let you control whether you&#8217;re sorting ascending or descending &#8211; e.g. cheapest first, or most expensive first.</p><p>Here&#8217;s a a quick tip to show how to control the sort order, just add the following snippet to your WordPress theme&#8217;s functions.php file:</p><pre name="code" class="php:nogutter:nocontrols">&lt;?php
    if (!isset($_SESSION['wpsc_product_order'])) {
        $_SESSION['wpsc_product_order'] = "DESC";
 }
 ?&gt;</pre><p>Just swap DESC for ASC to swap the default order. Happy sorting &#8230;</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/reverse-the-product-order-in-wp-e-commerce/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Adding Post Thumbnails To Your Sitemap</title><link>http://www.leewillis.co.uk/adding-post-thumbnails-to-sitemap/</link> <comments>http://www.leewillis.co.uk/adding-post-thumbnails-to-sitemap/#comments</comments> <pubDate>Sat, 17 Apr 2010 07:47:32 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[patches]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=243</guid> <description><![CDATA[Google recently blogged about Adding Images to your Sitemaps. When I read this my thoughts jumped straight to a friend&#8217;s site that is image-orientated, and could really benefit from this. His site uses WordPress&#8217; post thumbnails to store an image against each post, and I wanted to get those images into his sitemap. His site [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fadding-post-thumbnails-to-sitemap%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fadding-post-thumbnails-to-sitemap%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>Google recently blogged about <a
href="http://googlewebmastercentral.blogspot.com/2010/04/adding-images-to-your-sitemaps.html" target="_blank">Adding Images to your Sitemaps</a>. When I read this my thoughts jumped straight to a friend&#8217;s site that is image-orientated, and could really benefit from this. His site uses WordPress&#8217; post thumbnails to store an image against each post, and I wanted to get those images into his sitemap.</p><p>His site already uses the great <a
href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">Google XML Sitemaps</a> plugin to auto-generate an XML sitemap, so I thought I&#8217;d have a go at extending it to support post thumbnails.</p><p>The resulting XML looks a little like this:</p><pre class="html:nogutter:nocontrols">&lt;url&gt;
  &lt;loc&gt;http://test.leewillis.co.uk/hello-world/&lt;/loc&gt;
  &lt;image:image&gt;
    &lt;image:loc&gt;http://test.leewillis.co.uk/wp-content/uploads/test.jpg&lt;/image:loc&gt;
    &lt;image:title&gt;Hello world!&lt;/image:title&gt;
    &lt;image:license&gt;http://test.leewillis.co.uk/license/&lt;/image:license&gt;
  &lt;/image:image&gt;
  &lt;lastmod&gt;2010-04-14T21:15:15+00:00&lt;/lastmod&gt;
  &lt;changefreq&gt;monthly&lt;/changefreq&gt;
  &lt;priority&gt;1.0&lt;/priority&gt;
&lt;/url&gt;
</pre><p>Some notes on the above. The image title is set the same as the post&#8217;s title &#8211; which I figure should be a reasonable result, from a user and SEO point of view. The license URL is configurable (One per site).</p><p>I&#8217;ve submitted the code to the plugin author to hopefully get included, but if you can&#8217;t wait, there&#8217;s a patch file available <a
href="http://www.leewillis.co.uk/patches/google-sitemap-generator/post-thumbnail-images/image_url.diff">here</a> &#8211; just apply it with the &#8220;patch&#8221; utility.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/adding-post-thumbnails-to-sitemap/feed/</wfw:commentRss> <slash:comments>17</slash:comments> </item> <item><title>Region-based shipping with WP e-Commerce</title><link>http://www.leewillis.co.uk/region-based-shipping-wp-e-commerce/</link> <comments>http://www.leewillis.co.uk/region-based-shipping-wp-e-commerce/#comments</comments> <pubDate>Fri, 09 Apr 2010 20:32:26 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[e-commerce]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[shipping]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[WP E-Commerce]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=215</guid> <description><![CDATA[I&#8217;ve been asked a few times about how to split up countries into regions and charge shipping differently to the different areas in WP E-Commerce. This was something that was almost, but not quite possible with one of my existing plugins. Now it&#8217;s just a little bit easier. What You&#8217;ll Need WP E-Commerce (3.7.6 or [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fregion-based-shipping-wp-e-commerce%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fregion-based-shipping-wp-e-commerce%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>I&#8217;ve been asked a few times about how to split up countries into regions and charge shipping differently to the different areas in WP E-Commerce. This was something that was almost, but not quite possible with one of my existing plugins.</p><p>Now it&#8217;s just a little bit easier.</p><h2>What You&#8217;ll Need</h2><ul><li><a
href="http://wordpress.org/extend/plugins/wp-e-commerce/">WP E-Commerce (3.7.6 or later)</a></li><li>My <a
href="http://wordpress.org/extend/plugins/wp-e-commerce-weightregion-shipping/">Weight / Destination plugin</a></li><li>Database access to your WP e-Commerce database</li></ul><p>In this example we&#8217;re going to show how to achieve the following:</p><ul><li>Set of Weight rates for New Zealand (North Island)</li><li>Set of Weight rates for New Zealand (North Island)</li><li>Set of Weight rates for the rest of Asia/Pacific</li><li>Set of Weight rates for Europe</li></ul><h2>The Plan</h2><p>To acheive our end goal we&#8217;re going to:</p><ol><li>Create 2 regions attached to the country &#8220;New Zealand&#8221;</li><li>Remove New Zealand from the Asia and Pacific continent (So people ordering to NZ see those prices, not the general &#8220;Asia and Pacific&#8221; pricing</li><li>Set up per-country/region rates for New Zealand</li><li>Set up per-continent rates for Asia and Pacific, and Europe</li></ol><h2>Getting Started</h2><p>The first job is to find out the &#8220;country ID&#8221; for New Zealand. Using your favourite database you&#8217;ll want to look in the wp_wpsc_currency_list table for the entry for New Zealand, and make a note of the value of the &#8220;id&#8221; field &#8211; in our case 156.<br
/> <a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/nz-country.jpg" rel="lightbox[215]"><img
class="contentimg" title="nz-country" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/nz-country.jpg" alt="" width="495" height="80" /></a></p><p>While we&#8217;re here, we&#8217;ll also move New Zealand out of it&#8217;s current continent. This basically just involves updating the same record, and setting the continent field to something unique, e.g.<br
/> <a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/nz-country2.jpg" rel="lightbox[215]"><img
class="contentimg" title="nz-country2" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/nz-country2.jpg" alt="" width="231" height="234" /></a></p><p>Next &#8211; you&#8217;ll need to create whatever regions you want in the wp_wpsc_region_tax table, using the ID you&#8217;ve just found as the &#8220;country_id&#8221; field, e.g.<br
/> <a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/region-list.jpg" rel="lightbox[215]"><img
class="contentimg" title="region-list" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/region-list.jpg" alt="" width="401" height="86" /></a></p><h2>Configuring your pricing</h2><p>That&#8217;s all with the scary database stuff, now on to the easy stuff. First of all you&#8217;ll need to activate both of the shipping modules:<br
/> <a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/activate-shipping-modules.jpg" rel="lightbox[215]"><img
class="contentimg" title="activate-shipping-modules" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/activate-shipping-modules.jpg" alt="" width="249" height="169" /></a></p><p>First up we&#8217;ll configure the continent-based pricing. Click on &#8220;Edit&#8221; next to the weight-continent pricing. Up will pop the configuration pane, with a drop-down of the standard continents &#8211; and also our &#8220;newzealand&#8221; continent &#8211; which we&#8217;re not going to use since New Zealand is going to be priced by region.</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-continent-1.jpg" rel="lightbox[215]"><img
class="contentimg" title="weight-continent-1" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-continent-1.jpg" alt="" width="399" height="264" /></a></p><p>Let&#8217;s pick Europe, and configure some weight rates.<br
/> <a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-continent-2.jpg" rel="lightbox[215]"><img
class="contentimg" title="weight-continent-2" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-continent-2.jpg" alt="" width="401" height="206" /></a></p><p>In this case we&#8217;ve just configured one weight band &#8211; which means that anything shipped to Europe will be charged at the same rate &#8211; £80 in this case.</p><p>We can do the same for Asia and Pacific, except maybe setting up multiple layers using the &#8220;Add Layer&#8221; link.</p><p>At this stage shipping will work for Europe, Asia and Pacific, but not for New Zealand (Since we took it out of Asia and Pacific).</p><p>Click on &#8220;Edit&#8221; next to the Weight / Country and Region pricing. Up will pop the configuration pane, with a drop-down of the countries, including regions where configured &#8211; for example, we can see our North Island, and South Island regions here:</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-country-region.jpg" rel="lightbox[215]"><img
class="contentimg" title="weight-country-region" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-country-region.jpg" alt="" width="407" height="480" /></a></p><p>Selecting a region gives us the chance to configure weight rates, e.g.</p><p><a
href="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-country-region-2.jpg" rel="lightbox[215]"><img
class="contentimg" title="weight-country-region-2" src="http://www.leewillis.co.uk/wp-content/uploads/2010/04/weight-country-region-2.jpg" alt="" width="401" height="314" /></a></p><p>Repeat for other regions, and you&#8217;re set. Happy Shipping!</p><p><strong>Note:</strong> All weights should be set up in lbs, no matter what weight unit you used to set the weight for your products. WP e-Commerce will convert between them for you.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/region-based-shipping-wp-e-commerce/feed/</wfw:commentRss> <slash:comments>65</slash:comments> </item> <item><title>WordPress 2.9 e-Commerce</title><link>http://www.leewillis.co.uk/wordpress-2-9-e-commerce/</link> <comments>http://www.leewillis.co.uk/wordpress-2-9-e-commerce/#comments</comments> <pubDate>Sat, 06 Mar 2010 13:11:56 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[books]]></category> <category><![CDATA[e-commerce]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=201</guid> <description><![CDATA[WordPress 2.9 e-Commerce, has been published &#8211; the definitive guide to setting up an e-commerce site on your WordPress blog using the WP e-Commerce plugin, of which I&#8217;m a bit of a fan. This book provides an easy to understand, step-by-step approach to installing, configuring, and using WP e-Commerce to run your online store. We [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwordpress-2-9-e-commerce%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwordpress-2-9-e-commerce%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p><a
title="Wordpress 2.9 e-Commerce" href="http://www.amazon.co.uk/WordPress-2-9-E-Commerce-Brian-Bondari/dp/1847198503?&amp;camp=2486&amp;linkCode=wey&amp;tag=leewillis-21&amp;creative=20362" target="_blank"><img
class="contentimgleft" title="WordPress 2.9 E-Commerce" src="http://ecx.images-amazon.com/images/I/41QJ6nqwXBL._SL160_AA115_.jpg" alt="WordPress 2.9 E-Commerce " width="115" height="115" /></a><a
href="http://www.amazon.co.uk/WordPress-2-9-E-Commerce-Brian-Bondari/dp/1847198503?&amp;camp=2486&amp;linkCode=wey&amp;tag=leewillis-21&amp;creative=20362" target="_blank">WordPress 2.9 e-Commerce</a>, has been published &#8211; the definitive guide to setting up an e-commerce site on your WordPress blog using the <a
href="http://getshopped.org">WP e-Commerce</a> plugin, of which I&#8217;m a bit of a fan.</p><p>This book provides an easy to understand, step-by-step approach to  installing, configuring, and using WP e-Commerce to run your online  store. We will construct an example store in the book with enough  information and flexibility to adapt the store to your specific needs.</p><p><a
href="http://www.amazon.co.uk/WordPress-2-9-E-Commerce-Brian-Bondari/dp/1847198503?&amp;camp=2486&amp;linkCode=wey&amp;tag=leewillis-21&amp;creative=20362" target="_blank"> This book</a> is for you, if you are interested in using WordPress as the  basis for a store that can sell physical items, downloads, or services.  It is ideal for a sole proprietor or small business owner with only  basic, in-house technical skills. Some prior knowledge of WordPress will  help, but is not required. No knowledge of PHP is expected, but it will be helpful.</p><p>You can buy it from Amazon <a
href="http://www.amazon.co.uk/WordPress-2-9-E-Commerce-Brian-Bondari/dp/1847198503?&amp;camp=2486&amp;linkCode=wey&amp;tag=leewillis-21&amp;creative=20362" target="_blank">here</a>.</p><p><span
class="disclaimer">Disclaimer: I&#8217;ve linked to Amazon using affiliate links, to help fund this blog.</span></p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/wordpress-2-9-e-commerce/feed/</wfw:commentRss> <slash:comments>0</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 the URL of the image (So I could wrap the actual thumbnail in a lightbox-style [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fgetting-url-post-thumbnails-wordpress%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fgetting-url-post-thumbnails-wordpress%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><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>21</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 and other navigation (Links to recent articles, etc) in a right hand sidebar, and they [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fhow-to-split-test-wordpress-themes%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fhow-to-split-test-wordpress-themes%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><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>41</slash:comments> </item> <item><title>How to write an application for WordPress</title><link>http://www.leewillis.co.uk/writing-a-wordpress-application/</link> <comments>http://www.leewillis.co.uk/writing-a-wordpress-application/#comments</comments> <pubDate>Mon, 07 Sep 2009 21:36:12 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[joomla]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=132</guid> <description><![CDATA[I&#8217;ve recently been doing some work for a family member on a WordPress blog they run, and the need came up to build a mini-app. Now historically, I&#8217;m a Joomla kind of guy, and it&#8217;s fairly clear that for a Joomla site you would build a component to implement your app. However, in WordPress it&#8217;s [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwriting-a-wordpress-application%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Fwriting-a-wordpress-application%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>I&#8217;ve recently been doing some work for a family member on a WordPress blog they run, and the need came up to build a mini-app. Now historically, I&#8217;m a Joomla kind of guy, and it&#8217;s fairly clear that for a Joomla site you would build a component to implement your app.</p><p>However, in WordPress it&#8217;s a little different. I&#8217;ve found loads of articles about available API calls, manipulating &#8220;the loop&#8221; and all sorts of useful information. What I haven&#8217;t found though is something that explains at a fundamental level how I should approach the problem.</p><p>There isn&#8217;t a concept of an &#8220;application&#8221; under WordPress, the only items that are accessible are &#8220;posts&#8221; and &#8220;pages&#8221;. As far as I can tell, I have two options:</p><ol><li>Publish a post/page with no content other than a special string (E.g. [my-app]) and then write a plugin that filters post content and replaces the magic string with the output from the application</li><li>Create a page, and assign it a custom template. Implement your application in that custom template</li></ol><h4>Option 1</h4><p>It works, I know because this is what I did <img
src='http://www.leewillis.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />    However there is a performance penalty, your application code is called on every post, and so you have to take steps to make sure it doesn&#8217;t run unnecessarily. The other disadvantage is that well, it just doesn&#8217;t seem clean.</p><h4>Option 2</h4><p>This seems a little nicer, but doesn&#8217;t really fit with WordPress&#8217; nice plugin installation architecture &#8211; as far as I can tell plugins can&#8217;t auto-install into the current theme directory, and custom templates can&#8217;t live anywhere else.</p><p>So, this leaves me a little confused &#8211; can anyone point me as to how I should have solved this problem &#8211; or does WordPress need to grow up a little and add &#8220;application&#8221; alongside posts and pages?</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/writing-a-wordpress-application/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Tracking Twitter Traffic Redux</title><link>http://www.leewillis.co.uk/tracking-twitter-traffic-redux/</link> <comments>http://www.leewillis.co.uk/tracking-twitter-traffic-redux/#comments</comments> <pubDate>Fri, 07 Aug 2009 19:34:41 +0000</pubDate> <dc:creator>Lee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[hints]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.leewillis.co.uk/?p=116</guid> <description><![CDATA[I wrote a previous post about how you could hack the excellent Twitter Tools plugin from Alex King to add Google Analytics tracking variables to the URLs posted to twitter when you posted a new blog post. I submitted the patch upstream, and Alex kindly pointed out that rather than bodging around in his code [...]]]></description> <content:encoded><![CDATA[<div
class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.leewillis.co.uk%2Ftracking-twitter-traffic-redux%2F"><br
/> <img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.leewillis.co.uk%2Ftracking-twitter-traffic-redux%2F&amp;source=leewillis77&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br
/> </a></div><p>I wrote a previous post about how you could hack the excellent <a
href="http://alexking.org/projects/wordpress">Twitter Tools</a> plugin from Alex King to add Google Analytics tracking variables to the URLs posted to twitter when you posted a new blog post.</p><p>I submitted the patch upstream, and Alex kindly pointed out that rather than bodging around in his code &#8211; you could achieve the same effect with a filter.</p><p>So, here it is. Simply download <a
href="http://www.leewillis.co.uk/patches/twitter-tools-tagger.php">this file</a> and save it in your wp-content/plugins directory. Activate the plugin in your WordPress backend (It will be listed as &#8220;Twitter Tools Tagger&#8221;) and away you go. Whenever the twitter-tools plugin tweets about one of your blog posts, the URL will be tagged with analytics tracking.</p><p>As an added bonus, version 2.0 of Alex&#8217;s plugin can also pump your URLs through the http://bit.ly/ URL shortening service so your URLs will be tagged, and shortened.</p><p>So, that&#8217;s nice.</p> ]]></content:encoded> <wfw:commentRss>http://www.leewillis.co.uk/tracking-twitter-traffic-redux/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 11/18 queries in 0.007 seconds using disk

Served from: www.leewillis.co.uk @ 2010-09-07 08:13:18 -->