<?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>Ben Huson &#187; WordPress Plugins</title>
	<atom:link href="http://www.benhuson.co.uk/tag/wordpress-plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benhuson.co.uk</link>
	<description>Web Designer and Developer</description>
	<lastBuildDate>Fri, 03 Feb 2012 15:27:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WP e-Commerce Cross Sales</title>
		<link>http://www.benhuson.co.uk/2011/08/21/wp-e-commerce-cross-sales/</link>
		<comments>http://www.benhuson.co.uk/2011/08/21/wp-e-commerce-cross-sales/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 20:36:17 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[E-commerce]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=2155</guid>
		<description><![CDATA[Tweet The latest version of WP e-Commerce (3.8.x) for WordPress is a significant move on both in terms of stability and extensibility. This is partly down to an extensive re-build on the codebase to take advantage of some of WordPress&#8217; latest features; custom post type and taxonomies. This has the added benefit of making it [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2011/08/21/wp-e-commerce-cross-sales/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2011/08/21/wp-e-commerce-cross-sales/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong>The latest version of <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fgetshopped.org%2F&sref=rss" target="_blank">WP e-Commerce</a> (3.8.x) for WordPress is a significant move on both in terms of stability and extensibility.</strong></p>
<p>This is partly down to an extensive re-build on the codebase to take advantage of some of WordPress&#8217; latest features; custom post type and taxonomies. This has the added benefit of making it much easier for plugin developers to create add-on plugin to enhance WP e-Commerce functionality.</p>
<p>The key objectives now seem to be to keep WP e-Commerce &#8216;lean and mean&#8217; to provide a solid platform on which to develop WordPress-based e-commerce sites, and provide additional functionality through plugins.</p>
<p>Part of this process includes stripping out some of the less-used parts of WP e-Commerce and turning them into plugins. Once such example is the automated &#8216;Also Bought&#8217; functionality which can be found in the Marketing tab of WP e-Commerce settings.</p>
<p><a href="http://www.benhuson.co.uk/wp-content/uploads/wpsc-marketing-current.jpg"><img class="alignnone size-medium wp-image-2192 border" title="WP e-Commerce Cross Sales - Current Marketing Panel" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-marketing-current-400x162.jpg" alt="" width="400" height="162" /></a></p>
<p>I have worked extensively with WP e-Commerce over the last 2-3 years and frequently try to get involved wether it be fixing the odd bug or helping out on the forum &#8211; when I have time ;) so I jumped on board to help separate the &#8216;Also Bought&#8217; functionality into a WordPress plugin.</p>
<p><span id="more-2155"></span></p>
<h3>Also Bought &gt; Cross Sales</h3>
<p>The &#8216;Also Bought&#8217; functionality is now available to download as the &#8216;Cross Sales&#8217; plugin on <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwp-e-commerce-cross-sales%2F&sref=rss">WordPress Extend</a>.</p>
<p>The plugin will function exactly the same way as the current Also Bought feature in WP e-Commerce. When someone buys multiple products, this information will be saved so that we can identify that &#8220;someone who bought this also bought that&#8221;.</p>
<p>There are few small additions though:</p>
<p><a href="http://www.benhuson.co.uk/wp-content/uploads/wpsc-cross-sales-panel.jpg"><img class="alignnone size-medium wp-image-2191 border" title="WP e-Commerce Cross Sales - Panel" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-cross-sales-panel-400x157.jpg" alt="" width="400" height="157" /></a></p>
<p>You will be able to set a limit for the amount of cross sales you want to show &#8211; what looks best may  depend on the theme you are using.</p>
<p>By default, cross sale product images will be the same size as product thumbnail images, but there are now settings to override this if you want.</p>
<h3>Installing/Upgrading</h3>
<p>In WP e-Commerce 3.9 the also bought functionality will not be available by default, you&#8217;ll need to install the plugin. For those of you who are already using that functionality, don&#8217;t worry, I&#8217;ve made it easy for you&#8230; you&#8217;ll be able to install the plugin directly from the Marketing tab in WP e-Commerce and have it back up and running straight away.</p>
<p><a href="http://www.benhuson.co.uk/wp-content/uploads/wpsc-cross-sales-install-now.jpg"><img class="alignnone size-medium wp-image-2189 border" title="WP e-Commerce Cross Sales - Install Now" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-cross-sales-install-now-400x73.jpg" alt="" width="400" height="73" /></a></p>
<p>You can even install the plugin now if you like. It won&#8217;t do anything until you upgrade to WP e-Commerce 3.9 and the transition will be seamless.</p>
<p><img class="alignnone size-full wp-image-2190 border" title="WP e-Commerce Cross Sales - Upgrade Notice" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-cross-sales-notice.jpg" alt="" width="400" height="132" /></p>
<p>I recommend that you change the <code>wpsc_also_bought()</code> references in your single product theme template to the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wpsc_cross_sales'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> wpsc_cross_sales<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$product_id</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This will ensure compatibility in the future if you deactivate the plugin, and ensure it works with future versions. You don&#8217;t <em>need</em> to change this as the wpsc_also_bought() function should work for the time being, but it will cease to work in a future version of this plugin so do get around to changing it sooner rather than later.</p>
<h3>What next&#8230;?</h3>
<p>Expect to see other areas of WP e-Commerce being moved to separate plugins. My guess is the following features may at some point find themselves moved to external plugins:</p>
<ul>
<li>Social Integration, Like, Tweet etc&#8230;</li>
<li>Intense Debate comment integration</li>
<li>Custom survey</li>
<li>Off site product links</li>
<li>Personalisation options</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2011/08/21/wp-e-commerce-cross-sales/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using HeadSpace with Custom Post Types</title>
		<link>http://www.benhuson.co.uk/2010/09/14/headspace-custom-post-types/</link>
		<comments>http://www.benhuson.co.uk/2010/09/14/headspace-custom-post-types/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 19:56:46 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Custom Post Types]]></category>
		<category><![CDATA[HeadSpace]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1771</guid>
		<description><![CDATA[Tweet I frequently install HeadSpace, the WordPress SEO plugin by John Godley, when I work on a WordPress site. Recently I have been making use of the new custom post type features of WordPress 3.0 but found that the HeadSpace meta box for editing the title and description tags did not show on my custom [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2010/09/14/headspace-custom-post-types/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2010/09/14/headspace-custom-post-types/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong>I frequently install <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fheadspace2%2F&sref=rss">HeadSpace</a></strong><strong>, the WordPress SEO plugin by <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fall_noodles&sref=rss">John Godley</a></strong><strong>, when I work on a WordPress site.</strong></p>
<p>Recently I have been making use of the new custom post type features of WordPress 3.0 but found that the HeadSpace meta box for editing the title and description tags did not show on my custom post type edit screens.</p>
<p>After a bit of delving through the code I figured out the way to do this &#8211; note that this may only work if your custom post type uses the default post capabilities.</p>
<p>It checks that the HeadSpace class is available and if so adds the meta box to your custom post type edit screen. Just add the following code into your plugin or theme&#8217;s functions.php file replacing &#8216;myposttype&#8217; with your custom post type.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Add Headspace plugin support for myposttype
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> myposttype_headpspace_add_custom_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$headspace2</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'add_meta_box'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$headspace2</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		add_meta_box<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'headspacestuff'</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HeadSpace'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'headspace'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$headspace2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'metabox'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'myposttype'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'normal'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'high'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'myposttype_headpspace_add_custom_box'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2010/09/14/headspace-custom-post-types/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making your plugin meta boxes work with custom post types in WordPress 3.0</title>
		<link>http://www.benhuson.co.uk/2010/06/18/wp-meta-box-post-types/</link>
		<comments>http://www.benhuson.co.uk/2010/06/18/wp-meta-box-post-types/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 19:36:25 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Custom Post Types]]></category>
		<category><![CDATA[Meta Boxes]]></category>
		<category><![CDATA[Robots]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1580</guid>
		<description><![CDATA[Tweet Getting to grips with custom post types in WordPress 3.0? I am, and am finding they&#8217;re a great way to organise different content on your site and very easy to implement in just a few lines of code. However, the challenge now is for plugin developers to make their plugins play nice with custom [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2010/06/18/wp-meta-box-post-types/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2010/06/18/wp-meta-box-post-types/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong>Getting to grips with custom post types in WordPress 3.0?</strong></p>
<p>I am, and am finding they&#8217;re a great way to organise different content on your site and very easy to implement in <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fcodex.wordpress.org%2FFunction_Reference%2Fregister_post_type&sref=rss">just a few lines of code</a>.</p>
<p>However, the challenge now is for plugin developers to make their plugins play nice with custom post types. The main thing I&#8217;ve noticed so far is that most plugins only tend to add meta boxes to posts and pages, so here&#8217;s the first step &#8211; getting your WordPress plugin meta boxes to work with custom post types.</p>
<p><span id="more-1580"></span></p>
<h3>A Real World Example</h3>
<p>I needed to set some of my custom post type pages not to be indexed by search engines so I picked out the <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Frobots-meta%2F&sref=rss">Robots Meta</a> plugin by <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fyoast.com&sref=rss">Joost de Valk</a> &#8211; the best plugin for the job in my opinion &#8211; installed it, and found it was only showing a meta box when editing my posts and pages.</p>
<p>I&#8217;m going to use Joost&#8217;s plugin (version 3.3.1) to illustrate how you can get meta boxes to show for custom post types so <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Frobots-meta%2F&sref=rss">download it</a> and continue reading below.</p>
<h3>The Meta Boxes</h3>
<p>The file you&#8217;ll need to edit is robots-meta.php. The meta boxes are added to posts and pages by the meta_box function on line 24:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> meta_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Meta Boxes for Custom Post Types</h3>
<p>Firstly we&#8217;re going to check that the &#8216;get_post_types&#8217; function exists. If it does then we&#8217;ll loop through all the post types and add meta boxes. If not we&#8217;ll continue just to add for posts and pages.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> meta_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'get_post_types'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Handle posts, pages and custom post types here</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The next step is to get all the post types that have been registered &#8211; this will include the built-in post types for posts and pages. We then loop through them:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$post_types</span> <span style="color: #339933;">=</span> get_post_types<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'objects'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post_types</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post_type</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Handle each post type here</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then for each post type we are going to add a meta box. It is import to note that when you add a custom post type you can choose wether or not to automatically create the WordPress UI in the admin. We only want to add meta boxes if the UI is generated by WordPress so we add in an &#8216;if&#8217; statement to check.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>24
25
26
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post_type</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_ui</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	add_meta_box<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'noindex_option_fill'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post_type</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'side'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>The Finished Function</h3>
<p>So put all that together and this is what you get:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> meta_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'get_post_types'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$post_types</span> <span style="color: #339933;">=</span> get_post_types<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'objects'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post_types</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post_type</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post_type</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_ui</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				add_meta_box<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'noindex_option_fill'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post_type</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'side'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'robotsmeta'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Robots Meta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RobotsMeta_Admin'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'noindex_option_fill'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'side'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Please Note:</strong> This only deomstrates how you can add meta boxes for custom post types. There are other aspects such as checking user capabilities for different post types that may be applicable when you are saving your meta box data. See the capabilities arguments you can set in the <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fcodex.wordpress.org%2FFunction_Reference%2Fregister_post_type&sref=rss">register_post_type</a> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2010/06/18/wp-meta-box-post-types/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Category Paging Functions in WP e-Commerce 3.7.6</title>
		<link>http://www.benhuson.co.uk/2010/03/10/wpsc-paging/</link>
		<comments>http://www.benhuson.co.uk/2010/03/10/wpsc-paging/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 09:30:31 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[E-commerce]]></category>
		<category><![CDATA[Paging]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1461</guid>
		<description><![CDATA[Tweet WP e-Commerce 3.7.6 now includes better support for paging on category pages. The latest release contains a suite of functions (my little contribution) to help you customise how pagination is displayed in your WPSC templates. You can find an in-depth look at these functions and how to use them in the WP e-Commerce Documentation. [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2010/03/10/wpsc-paging/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2010/03/10/wpsc-paging/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fgetshopped.org%2Fgetshopped-news%2Fwp-e-commerce-3-7-6-rc-1-is-out%2F&sref=rss">WP e-Commerce 3.7.6</a> now includes better support for paging on category pages.</strong></p>
<p>The latest release contains a suite of functions (my little contribution) to help you customise how pagination is displayed in your WPSC templates.</p>
<p>You can find an in-depth look at these functions and how to use them in the <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fgetshopped.org%2Fresources%2Fdocs%2Fdesign-and-layout%2Fpagination%2F&sref=rss">WP e-Commerce Documentation</a>.</p>
<p>Below are some quick examples of what you can do&#8230;</p>
<p><span id="more-1461"></span></p>
<h3>Basic paging</h3>
<p><img class="border" title="wpsc-paging" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-paging.gif" alt="" width="400" height="50" /></p>
<p>Some fairly standard paging with linked page numbers, previous and next links, and arrow links to take to to the first and last pages. You can customise the text that is used for previous, next, first and last links.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_first_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&amp;laquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_previous_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'previous'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_pagination<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_next_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'next'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_last_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&amp;raquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Limit the amount of pages</h3>
<p><img class="alignnone size-full wp-image-1462 border" title="wpsc-paging-page-x-of-x" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-paging-page-x-of-x.gif" alt="" width="400" height="90" /></p>
<p>You can limit the amount of page links to show at one time. The above example shows what happens if there are 10 pages of products, but only showing 7 page links at a time. Notice also the text describing which page you&#8217;re on and that the previous and first links are greyed out when not applicable &#8211; you can also choose to hide them instead of showing inactive links.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Page <span style="color: #000000; font-weight: bold;">&lt;?php</span> wpsc_showing_products_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>:
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_first_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&amp;laquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_previous_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'previous'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_pagination<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">7</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_next_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'next'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_last_products_link<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&amp;raquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Total number of products</h3>
<p><img class="border" title="wpsc-paging-showing-x-products" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-paging-showing-x-products.gif" alt="" width="400" height="50" /></p>
<p>There is a function to easily display the total number of products. You can detect if the category has multiple pages and if it doesn&#8217;t display something like this instead.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> wpsc_has_pages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   &lt;!-- Insert pagination for multiple pages --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   Showing <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wpsc_total_product_count<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> products
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Number of products showing</h3>
<p><img class="alignnone size-full wp-image-1463 border" title="wpsc-paging-showing-x-of-x-products" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-paging-showing-x-of-x-products.gif" alt="" width="400" height="50" /></p>
<p>You can display an indication as to which products are showing depending on which page you&#8217;re viewing.</p>

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

<h3>What next?</h3>
<p>The new WP e-Commerce default themes contain examples of pagination so hop into your templates and <a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fgetshopped.org%2Fresources%2Fdocs%2Fdesign-and-layout%2Fpagination%2F&sref=rss">create some nice pagination&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2010/03/10/wpsc-paging/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Customise the Terms and Conditions Checkbox and Link in WP e-Commerce</title>
		<link>http://www.benhuson.co.uk/2010/02/09/wpsc-terms-checkbox/</link>
		<comments>http://www.benhuson.co.uk/2010/02/09/wpsc-terms-checkbox/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 21:15:19 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[E-commerce]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1403</guid>
		<description><![CDATA[Tweet By default the terms and conditions link on the checkout page in WP e-Commerce activates an overlay popup containing the terms and conditions text you have specified in the admin. But what if you want the link to redirect to a page instead of triggering this popup? You just need to make a small [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2010/02/09/wpsc-terms-checkbox/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2010/02/09/wpsc-terms-checkbox/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p>By default the terms and conditions link on the checkout page in WP e-Commerce activates an overlay popup containing the terms and conditions text you have specified in the admin.</p>
<p><img class="alignnone size-full wp-image-1434 border" title="WPSC Terms Popup" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-terms-popup.gif" alt="" width="400" height="240" /></p>
<p>But what if you want the link to redirect to a page instead of triggering this popup? You just need to make a small change to your checkout template. Here&#8217;s what you need to do&#8230;</p>
<p><span id="more-1403"></span></p>
<h3>In The Admin</h3>
<p>In the admin, instead of specifying terms and conditions text we are going to enter a URL. Make sure your URL is a full path including &#8216;http://&#8217; as this will make it easier to detect wether the content is a URL or plain text.</p>
<p><img class="alignnone size-full wp-image-1425 border" title="WPSC Settings Terms" src="http://www.benhuson.co.uk/wp-content/uploads/wpsc-settings-terms.gif" alt="" width="400" height="230" /></p>
<h3>Changes in your WP e-Commerce Theme</h3>
<p>Your WP e-Commerce theme files usually reside in the &#8216;wp-content/uploads/wpsc/themes/your-theme&#8217; directory. To change the terms and conditions link to link to another page rather that popup you will need to edit the &#8216;shopping_cart_page.php&#8217; file.</p>
<p>In this file look for the terms and condition code. It will be near the bottom and should look a bit like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>297
298
299
300
301
302
303
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'terms_and_conditions'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr&gt;
   &lt;td colspan='2'&gt;
      &lt;input type='checkbox' value='yes' name='agree' /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> TXT_WPSC_TERMS1<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;a class='thickbox' target='_blank' href='<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?termsandconds=true&amp;amp;width=360&amp;amp;height=400'&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>' class='termsandconds'&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> TXT_WPSC_TERMS2<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
   &lt;/td&gt;
&lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>What we will do is change this code so if the contents of your terms and condition is a link (beginning http://) it will write a link to that page rather than a popup. The new code with the if statement should look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>297
298
299
300
301
302
303
304
305
306
307
308
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'terms_and_conditions'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr class=&quot;terms&quot;&gt;
   &lt;td colspan='2'&gt;
      &lt;input type='checkbox' value='yes' name='agree' /&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> TXT_WPSC_TERMS1<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'terms_and_conditions'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'http://'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
         &lt;a target='_blank' href='<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'terms_and_conditions'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>' class='termsandconds'&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> TXT_WPSC_TERMS2<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
         &lt;a class='thickbox' target='_blank' href='<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?termsandconds=true&amp;amp;width=360&amp;amp;height=400'&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>' class='termsandconds'&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> TXT_WPSC_TERMS2<span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   &lt;/td&gt;
&lt;/tr&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>And that&#8217;s all there is to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2010/02/09/wpsc-terms-checkbox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>List Pages at Depth 1.1</title>
		<link>http://www.benhuson.co.uk/2010/01/25/list-pages-at-depth-1-1/</link>
		<comments>http://www.benhuson.co.uk/2010/01/25/list-pages-at-depth-1-1/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:33:46 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1366</guid>
		<description><![CDATA[Tweet Just released an update to the List Pages at Depth plugin for WordPress. This update fixed a pretty major bug which prevented the list showing the correct branch of subpages when the start depth was greater than 1 (secondary level pages). Now this is fixed you&#8217;ll be able to display a list of only [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2010/01/25/list-pages-at-depth-1-1/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2010/01/25/list-pages-at-depth-1-1/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong>Just released an update to the </strong><a href="http://www.benhuson.co.uk/wordpress-plugins/list-pages-at-depth/"><strong>List Pages at Depth</strong></a><strong> plugin for WordPress.</strong></p>
<p>This update fixed a pretty major bug which prevented the list showing the correct branch of subpages when the start depth was greater than 1 (secondary level pages).</p>
<p>Now this is fixed you&#8217;ll be able to display a list of only tertiary level pages &#8211; Useful if you have a site with a horizontal navigation with drop down menus for secondary level navigation, and want to show and subpages of the secondary level as a list in your sidebar.</p>
<p>What&#8217;s more the plugin now includes a widget so you can easily add a list of subpages into your sidebar.</p>
<p><span id="more-1366"></span></p>
<h3>Widget Examples</h3>
<p>The following configuration will display a list of secondary and tertiary level pages (depths 1 to 2) for the currently selected primary navigation item. The list of pages will show for all pages that are subpages (or sub-subpages) of that primary page.</p>
<p><a href="http://www.benhuson.co.uk/wp-content/uploads/list-pages-at-depth-sec.jpg"><img class="alignnone size-full wp-image-1376" title="List Pages at Depth - Secondary Nav" src="http://www.benhuson.co.uk/wp-content/uploads/list-pages-at-depth-sec.jpg" alt="" width="285" height="505" /></a></p>
<p>The widget below will only display the tertiary level (depth 2) of navigation for subpages of the currently selected secondary level page.</p>
<p><a href="http://www.benhuson.co.uk/wp-content/uploads/list-pages-at-depth-ter.jpg"><img class="alignnone size-full wp-image-1377" title="List Pages at Depth - Tertiary Nav" src="http://www.benhuson.co.uk/wp-content/uploads/list-pages-at-depth-ter.jpg" alt="" width="285" height="505" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2010/01/25/list-pages-at-depth-1-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New style hooks for WordPress Theme Developers in WP e-Commerce 3.7.5</title>
		<link>http://www.benhuson.co.uk/2009/11/12/new-style-hooks-for-wordpress-theme-developers-in-wp-e-commerce-3-7-5/</link>
		<comments>http://www.benhuson.co.uk/2009/11/12/new-style-hooks-for-wordpress-theme-developers-in-wp-e-commerce-3-7-5/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 17:16:17 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1170</guid>
		<description><![CDATA[Tweet The latest version of Instinct&#8217;s WordPress e-commerce plugin uses the WordPress body_class filter to add classes to the HTML body tag. WP e-Commerce 3.7.5 adds the following styles to the body tag: wpsc wpsc-home wpsc-single-product wpsc-single-product-id wpsc-category wpsc-category-id wpsc-group-id wpsc-shopping-cart wpsc-transaction-details wpsc-user-account These extra classes will give you more flexibility when designing themes for [...]]]></description>
			<content:encoded><![CDATA[
<!-- This is the start of the WP Twitter Button code -->
<div id="rk_wp_twitter_button" style="margin: 0px 0px 0px 0px; float: left"><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Ftwitter.com%2Fshare&sref=rss" class="twitter-share-button" data-url="http://www.benhuson.co.uk/2009/11/12/new-style-hooks-for-wordpress-theme-developers-in-wp-e-commerce-3-7-5/" data-count="horizontal" data-via="benhuson">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<!-- This is the end of the WP Twitter Button code -->

 
<span class = "facebook-like" style = "height: 25px;  "><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.benhuson.co.uk/2009/11/12/new-style-hooks-for-wordpress-theme-developers-in-wp-e-commerce-3-7-5/&layout=button_count&send=false&show_faces=false&width=&action=like&colorscheme=light&font=lucida grande" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:px; height:25px"></iframe></span><p><strong>The latest version of Instinct&#8217;s WordPress e-commerce plugin uses the WordPress body_class filter to add classes to the HTML body tag.</strong></p>
<p><a href="http://redirectingat.com?id=3206X604054&xs=1&url=http%3A%2F%2Fwww.instinct.co.nz%2Fblog%2F2009%2F11%2Fwp-e-commerce-plugin-3-7-5-ready-for-prime-time%2Ftrackback%2F&sref=rss">WP e-Commerce 3.7.5</a> adds the following styles to the body tag:</p>
<ul>
<li>wpsc</li>
<li>wpsc-home</li>
<li>wpsc-single-product</li>
<li>wpsc-single-product-id</li>
<li>wpsc-category</li>
<li>wpsc-category-id</li>
<li>wpsc-group-id</li>
<li>wpsc-shopping-cart</li>
<li>wpsc-transaction-details</li>
<li>wpsc-user-account</li>
</ul>
<p>These extra classes will give you more flexibility when designing themes for WP e-Commerce.</p>
<p><span id="more-1170"></span></p>
<h3>Where are these classes included?</h3>
<p><strong>wpsc</strong><br />
Included in every WP e-Commerce page.</p>
<p><strong>wpsc-home</strong><br />
Included on the main WP e-Commerce shop page.</p>
<p><strong>wpsc-single-product &amp; wpsc-single-product-id</strong><br />
Included on single product pages. The wpsc-single-product-id class allows you to set css rules for a single product based on the product id.</p>
<p><strong>wpsc-category &amp; wpsc-category-id</strong><br />
Included on category and individual product pages. The wpsc-category-id class allows you to set css rules for different categories. As these classes are also applied to single product pages, if a product appears in more than one category you could style a product page differently depending on which category you click through from.</p>
<p><strong>wpsc-group-id</strong><br />
Included on category and single product pages. The group id is set based on the group in which the current category resides.</p>
<p><strong>wpsc-shopping-cart</strong><br />
Including on the shop cart checkout page.</p>
<p><strong>wpsc-transaction-details</strong><br />
Including on the transaction details page displayed after a successful purchase.</p>
<p><strong>wpsc-user-account</strong><br />
Including on the WP e-Commerce user account pages.</p>
<h3>Ideas how to use these classes in your WP e-Commerce theme&#8230;</h3>
<ol>
<li>Style a special product differently using wpsc-single-product-id.</li>
<li>Style products in a sale category to display differently using wpsc-category-id.</li>
<li>Create a group for brands with brands as sub-categories and differentiate this view from your standard product categories using wpsc-group-id.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2009/11/12/new-style-hooks-for-wordpress-theme-developers-in-wp-e-commerce-3-7-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

