<?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>Webpacks</title>
	<atom:link href="http://www.webpacks.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webpacks.co.uk</link>
	<description>Web Design</description>
	<lastBuildDate>Sat, 22 Oct 2011 06:54:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>URL Shorteners for Use in WordPress Themes</title>
		<link>http://www.webpacks.co.uk/url-shorteners-for-use-in-wordpress-themes</link>
		<comments>http://www.webpacks.co.uk/url-shorteners-for-use-in-wordpress-themes#comments</comments>
		<pubDate>Mon, 15 Aug 2011 20:11:20 +0000</pubDate>
		<dc:creator>Richard Dows</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.webpacks.co.uk/?p=836</guid>
		<description><![CDATA[After having tried a couple of URL shorteners in several themes, I thought I'd pass along the work so others can use it. The ones I have so far are: bit.ly tiny.url goo.gl su.pr Bit.ly Tiny.Url Goo.gl Su.Pr Hooking It Up To wp_get_shortlink() that is. Somewhere after your url shortener code, add this bit of [...]]]></description>
			<content:encoded><![CDATA[<p>After having tried a couple of URL shorteners in several themes, I thought I'd pass along the work so others can use it.</p>
<p>The ones I have so far are:</p>
<ul>
<li><a href="#bit.ly">bit.ly</a></li>
<li><a href="#tiny.url">tiny.url</a></li>
<li><a href="#goo.gl">goo.gl</a></li>
<li><a href="#su.pr">su.pr</a></li>
</ul>
<p><a name="bit.ly"></a><br />
<h2>Bit.ly</h2>
<pre class="brush: php; title: ; notranslate">
function getBitlyUrl() {
  //login information
  $url = get_permalink();  // generates wordpress' permalink
  $login = 'jbbrwcky';	// your bit.ly login
  $apikey = 'R_5e1afc5207fce1beb266c01ad9694aa9'; // bit.ly apikey
  $format = 'json';	// choose between json or xml
  $version = '2.0.1';

  // create the URL
  $bitly = 'http://api.bit.ly/shorten?version='. $version .'&amp;longUrl='. urlencode($url) .'&amp;login='. $login .'&amp;apiKey='. $apikey .'&amp;format='. $format;

  // get the url
  $response = file_get_contents($bitly);

  // parse depending on desired format
  if (strtolower($format) == 'json') {
    $json = @json_decode($response,true);
    return $json['results'][$url]['shortUrl'];
  } else {
    $xml = simplexml_load_string($response);
    return 'http://bit.ly/'.$xml-&gt;results-&gt;nodeKeyVal-&gt;hash;
  }
}
</pre>
<p><a name="tiny.url"></a><br />
<h2>Tiny.Url</h2>
<pre class="brush: php; title: ; notranslate">
function getTinyUrl() {
  $url = get_permalink();
  $tinyurl = file_get_contents(&quot;http://tinyurl.com/api-create.php?url=&quot;. $url);
  return $tinyurl;
}
</pre>
<p><a name="goo.gl"></a><br />
<h2>Goo.gl</h2>
<pre class="brush: php; title: ; notranslate">
function getGoogle($url, $post_id) {
  global $post;
  if (!$post_id &amp;&amp; $post) $post_id = $post-&gt;ID;

  if ($post-&gt;post_status != 'publish')
    return &quot;&quot;;

  $shortlink = get_post_meta($post_id, '_googl_shortlink', true);
  if ($shortlink)
    return $shortlink;

  $permalink = get_permalink($post_id);

  $http = new WP_Http();
  $headers = array('Content-Type' =&gt; 'application/json');
  $result = $http-&gt;request('https://www.googleapis.com/urlshortener/v1/url', array( 'method' =&gt; 'POST', 'body' =&gt; '{&quot;longUrl&quot;: &quot;' . $permalink . '&quot;}', 'headers' =&gt; $headers));
  $result = json_decode($result['body']);
  $shortlink = $result-&gt;id;

  if ($shortlink) {
    add_post_meta($post_id, '_googl_shortlink', $shortlink, true);
    return $shortlink;
  } else {
    return $url;
  }
}
</pre>
<p><a name="su.pr"></a><br />
<h2>Su.Pr</h2>
<pre class="brush: php; title: ; notranslate">
function getSuPr() {
  $url = get_permalink();
  $supr = file_get_contents(&quot;http://su.pr/api?url=&quot;. $url);
  return $supr;
}
</pre>
<p><a name="get_shortlink"></a><br />
<h2>Hooking It Up</h2>
<p>To <em>wp_get_shortlink()</em> that is. Somewhere after your url shortener code, add this bit of code into the functions.php file, replacing 'your_function_name' with the name of the function you want to use.</p>
<pre class="brush: php; title: ; notranslate">
add_filter('get_shortlink', 'your_function_name', 9);
</pre>
<p>Then to use the code, put this into the theme files of your choice.</p>
<pre class="brush: php; title: ; notranslate">
echo &quot;Shortlink: &quot; . wp_get_shortlink();
</pre>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/url-shorteners-for-use-in-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Category and Posts Widget</title>
		<link>http://www.webpacks.co.uk/category-and-posts-widget</link>
		<comments>http://www.webpacks.co.uk/category-and-posts-widget#comments</comments>
		<pubDate>Fri, 12 Aug 2011 09:06:32 +0000</pubDate>
		<dc:creator>Richard Dows</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WP Nuts & Bolts]]></category>

		<guid isPermaLink="false">http://www.webpacks.co.uk/?p=826</guid>
		<description><![CDATA[Responding to a need, this is a small widget that lets the user select the categories to show with the posts that belong to each category. The category can be a single category (by ID: 4) or a comma-delineated list of categories (by ID: 4,7,10). This is a modification of the widget/plugin provided by Transformation [...]]]></description>
			<content:encoded><![CDATA[<p>Responding to a need, this is a small widget that lets the user select the categories to show with the posts that belong to each category. The category can be a single category (by ID: 4) or a comma-delineated list of categories (by ID: 4,7,10).</p>
<p>This is a modification of the widget/plugin provided by <a href="http://www.transformationpowertools.com/wordpress/">Transformation Power Tools</a>, which provided some category functionality but not what we were looking for at the time. Nevertheless, a big thanks is due to them.</p>
<h2>Admin/Widget Options</h2>
<p><a href="http://www.webpacks.co.uk/wp-content/uploads/2011/08/admin-options.png"><img src="http://www.webpacks.co.uk/wp-content/uploads/2011/08/admin-options-226x300.png" alt="" title="Admin Options" width="226" height="300" class="alignright size-medium wp-image-828" /></a><br />
As you can see from the admin options, you can select how many posts to show in each category, to show the post count, the title of the widget, and also which categories to display with their posts.</p>
<p>To show a category just list it by ID (i.e., '4'), to show multiple categories list them by a comma-delineated list of IDs (i.e., '4,7'). Future versions may include a dropdown list.</p>
<div class="clearfix">&nbsp;</div>
<h2>Widget Appearance</h2>
<p><a href="http://www.webpacks.co.uk/wp-content/uploads/2011/08/example.png"><img src="http://www.webpacks.co.uk/wp-content/uploads/2011/08/example.png" alt="" title="example" width="207" height="247" class="alignright size-full wp-image-829" /></a></p>
<p>The appearance shows the <strong>Categories and Posts Widget</strong> in action, in this case showing two categories with their posts. This also shows something else, that a post will only be shown once; in this particular case one of the posts is in both categories, but shown just once.</p>
<div class="clearfix">&nbsp;</div>
<h3>Download</h3>
<p>Download the <a href="http://www.webpacks.co.uk/downloads/categories-and-posts.zip" rel="tag">Categories &#038; Posts Widget</a>. Install in the wp-content/plugins/ directory, then activate in the Plugins section in your WordPress admin backend.</p>
<p>To use it, go into the Widgets section, then drag into your sidebar of choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/category-and-posts-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using body_class() For IE Detection</title>
		<link>http://www.webpacks.co.uk/using-body_class-for-ie-detection</link>
		<comments>http://www.webpacks.co.uk/using-body_class-for-ie-detection#comments</comments>
		<pubDate>Fri, 29 Jul 2011 16:22:52 +0000</pubDate>
		<dc:creator>Richard Dows</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.webpacks.co.uk/?p=812</guid>
		<description><![CDATA[Specifically, in this case, IE9 and IE8 detection. Sometimes it is necessary to look for particular versions of a browser, IE being the most prevalent in my experience. This is a case where we look for IE8/IE9, then apply a class to the body, which makes it easy to apply a css style from that [...]]]></description>
			<content:encoded><![CDATA[<p>Specifically, in this case, IE9 and IE8 detection.</p>
<p>Sometimes it is necessary to look for particular versions of a browser, IE being the most prevalent in my experience. This is a case where we look for IE8/IE9, then apply a class to the body, which makes it easy to apply a css style from that point.</p>
<p>In the header.php file, where the body tag begins, make sure it looks like this:</p>
<blockquote><p>
&lt;body &lt;?php body_class(); ?&gt;&gt;
</p></blockquote>
<p>In the functions.php file add the following:</p>
<blockquote><p>
add_filter(&#39;body_class&#39;,&#39;my_body_classes&#39;);<br />
function my_body_classes($classes) {<br />
&nbsp;&nbsp;$classes[] = &#39;default&#39;;</p>
<p>&nbsp;&nbsp;if (preg_match(&#39;/TRIDENT\/5.0/i&#39;, $_SERVER[&#39;HTTP_USER_AGENT&#39;])) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;$classes[] = &#39;ie9-browser&#39;;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;if (preg_match(&#39;/TRIDENT\/4.0/i&#39;, $_SERVER[&#39;HTTP_USER_AGENT&#39;])) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;$classes[] = &#39;ie8-browser&#39;;<br />
&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;return $classes;<br />
}
</p></blockquote>
<p>Using the HTTP_USER_AGENT user agent string, we can search it looking for <a href="http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/33e0ed49-11fb-4d91-857c-a35496e90075/" title="TRIDENT/4.0 Internet Explorer User Agent String">TRIDENT/4.0</a> (for IE8) or TRIDENT/5.0 (which is found in IE9's user agent string). Once it's found, we can then alter the $classes[] array and add a class to identify the <strong>IE8</strong> or <strong>IE9</strong> browser.</p>
<p>Clearly, from there, easy to use css to target IE8 or IE9 only. This is another method to target IE8/9 if you don't want to use stylesheet hacks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/using-body_class-for-ie-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart Fencing</title>
		<link>http://www.webpacks.co.uk/smart-fencing</link>
		<comments>http://www.webpacks.co.uk/smart-fencing#comments</comments>
		<pubDate>Thu, 09 Dec 2010 12:40:24 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://www.webpacks.co.uk/?p=321</guid>
		<description><![CDATA[Smart Fencing is a friendly, reliable family run business, supplying and erecting all types of fencing to both domestic and commercial clients, in and around East Sussex and West Sussex. Quality of workmanship and customer satisfaction plays a vital role in our fencing and landscaping business and we pride ourselves in providing the highest quality [...]]]></description>
			<content:encoded><![CDATA[<p>Smart Fencing is a friendly, reliable family run business, supplying and erecting all types of fencing to both domestic and commercial clients, in and around East Sussex and West Sussex. Quality of workmanship and customer satisfaction plays a vital role in our fencing and landscaping business and we pride ourselves in providing the highest quality in both service and products</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/smart-fencing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tanya Knight Therapies</title>
		<link>http://www.webpacks.co.uk/tanya-knight-therapies</link>
		<comments>http://www.webpacks.co.uk/tanya-knight-therapies#comments</comments>
		<pubDate>Tue, 23 Nov 2010 13:08:05 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=6</guid>
		<description><![CDATA[Tanya Knight Therapies...provide Sports massage, deep tissue, aromatherapy, Swedish massage, Reflexology, pregnancy massage, indian head massage, acupressure chair massage and organic facials.]]></description>
			<content:encoded><![CDATA[<p><strong>Tanya Knight Therapies</strong>...provide Sports massage, deep tissue, aromatherapy, Swedish massage, Reflexology, pregnancy massage, indian head massage, acupressure chair massage and organic facials.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/tanya-knight-therapies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dance Like Nobodys Watching</title>
		<link>http://www.webpacks.co.uk/dance-like-nobodys-watching</link>
		<comments>http://www.webpacks.co.uk/dance-like-nobodys-watching#comments</comments>
		<pubDate>Sat, 20 Nov 2010 13:06:21 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=43</guid>
		<description><![CDATA['Dance Like Nobodys Watching'...Have your wedding dance choreographed in the comfort of your own home! Its great fun and you get to spend time together and share a special secret before the wedding! Give your 1st dance the wow factor and impress your guests. No experience needed, just choose your special song or songs and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>'Dance Like Nobodys Watching'</strong>...Have your wedding dance choreographed in the comfort of your own home!     Its great fun and you get to spend time together and share a special secret before the wedding! <em>Give your 1st dance the wow factor</em> and impress your guests. No experience needed, just choose your special song or songs and then <em>'Dance Like Nobodys Watching'</em></p>
<p>Dance Like Nobody’s Watching is a Webpacks ‘Virtual Business Card’ consisting of a single page web presence, giving full contact information and details of upcoming events. This single page website also includes YouTube video and Facebook Fan Page link.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/dance-like-nobodys-watching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Guitar Grotto</title>
		<link>http://www.webpacks.co.uk/the-guitar-grotto</link>
		<comments>http://www.webpacks.co.uk/the-guitar-grotto#comments</comments>
		<pubDate>Sat, 20 Nov 2010 13:00:24 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=39</guid>
		<description><![CDATA[The Guitar Grotto (formerly The Gretsch Grotto) is one of the few independant websites dedicated to selling Gretsch guitars at unbelievably low prices with some models being discounted by up to as much as 35% off the RRP.]]></description>
			<content:encoded><![CDATA[<p><strong>The Guitar Grotto</strong> (formerly The Gretsch Grotto) is one of the few independant websites dedicated to selling Gretsch guitars at unbelievably low prices with some models being discounted by up to as much as 35% off the RRP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/the-guitar-grotto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Countywide Driving School</title>
		<link>http://www.webpacks.co.uk/countywide-driving-school</link>
		<comments>http://www.webpacks.co.uk/countywide-driving-school#comments</comments>
		<pubDate>Sat, 20 Nov 2010 12:53:26 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=33</guid>
		<description><![CDATA[The Countywide Driving School team are there to help and advise you on all aspects of learning to drive. Their website will direct you towards a better understanding as to why you have chosen the best driving school for You.]]></description>
			<content:encoded><![CDATA[<p><strong>The Countywide Driving School</strong> team are there to help and advise you on all aspects of learning to drive. Their website will direct you towards a better understanding as to why you have chosen the best driving school for You.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/countywide-driving-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Beauty Retreat</title>
		<link>http://www.webpacks.co.uk/the-beauty-retreat</link>
		<comments>http://www.webpacks.co.uk/the-beauty-retreat#comments</comments>
		<pubDate>Sat, 20 Nov 2010 12:46:31 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=30</guid>
		<description><![CDATA[The Beauty Retreat @ Goldilocks. A beautiful relaxing place where you will find a full range of Beauty Treatments and Advanced Electrolysis carried out by, myself, Clare White. A professional Beauty Therapist with over 10 years experience..]]></description>
			<content:encoded><![CDATA[<p><strong>The Beauty Retreat @ Goldilocks.</strong> A beautiful relaxing place where you will find a full range of Beauty Treatments and Advanced Electrolysis carried out by, myself, Clare White. A professional Beauty Therapist with over 10 years experience..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/the-beauty-retreat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASM Marine Sonic</title>
		<link>http://www.webpacks.co.uk/asm-marine-sonic</link>
		<comments>http://www.webpacks.co.uk/asm-marine-sonic#comments</comments>
		<pubDate>Wed, 17 Nov 2010 13:08:35 +0000</pubDate>
		<dc:creator>Webpacks Administrator</dc:creator>
				<category><![CDATA[Recent Projects]]></category>

		<guid isPermaLink="false">http://webpacks.co.uk/?p=8</guid>
		<description><![CDATA[ASM Marine Sonic UK supply and fit the highest quality, most powerful algae control systems available on the market, they pride themselves on using the finest components and workmanship. All ASM marine sonic products are designed for their individual purpose and have evolved from over a decade of research and development. ASM marine sonic is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ASM Marine Sonic UK</strong> supply and fit the highest quality, most powerful algae control systems available on the market, they pride themselves on using the finest components and workmanship. All ASM marine sonic products are designed for their individual purpose and have evolved from over a decade of research and development. ASM marine sonic is used worldwide with outstanding success and feedback. Bespoke systems are available to control algae in any environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpacks.co.uk/asm-marine-sonic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
