
<?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>rjackson</title>
	<atom:link href="http://rjackson.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://rjackson.ca</link>
	<description></description>
	<lastBuildDate>Fri, 13 Aug 2010 03:54:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WordPress 3.0</title>
		<link>http://rjackson.ca/blog/2010/08/wordpress-3-0/</link>
		<comments>http://rjackson.ca/blog/2010/08/wordpress-3-0/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 03:51:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://rjackson.ca/?p=31</guid>
		<description><![CDATA[WordPress, I love you. Even though there&#8217;s some really annoying things you do. Sorry if I had to tell you. It&#8217;s ok now; I&#8217;m finding ways to deal with it. Your retarded gallery settings Do you really have to add CSS mid-post? Andâ€¦ I didn&#8217;t get far with the original gallery, but I didn&#8217;t want [...]]]></description>
			<content:encoded><![CDATA[<h2>WordPress, I love you.</h2>
<p>Even though there&#8217;s some really annoying things you do. Sorry if I had to tell you. It&#8217;s ok now; I&#8217;m finding ways to deal with it.</p>
<p><span id="more-31"></span></p>
<h3>Your retarded gallery settings</h3>
<p>Do you really have to add CSS mid-post? Andâ€¦ I didn&#8217;t get far with the original gallery, but I didn&#8217;t want to use a non native gallery. Right before I hacked the code myself I found a nice site that had solved it in a more elegant manner (<code class="codecolorer text default"><span class="text">remove_shortcode()</span></code> and <code class="codecolorer text default"><span class="text">add_shortcode()</span></code> are what got me, the rest is removing styling from the original WP module).</p>
<p><a href="http://wpengineer.com/1802/a-solution-for-the-wordpress-gallery/">A Solution For The WordPress Gallery</a></p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//deactivate WordPress function</span><br />
remove_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gallery'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gallery_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gallery'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wpe_gallery_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> wpe_gallery_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wp_locale</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; static <span style="color: #000088;">$instance</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$instance</span><span style="color: #339933;">++;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Allow plugins/themes to override the default gallery template.</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_gallery'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// We're trusting author input, so let's at least make sure it looks like a valid orderby statement</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> sanitize_sql_orderby<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'orderby'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'order'</span> &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'ASC'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'orderby'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'menu_order ID'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'id'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>ID<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'itemtag'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'dl'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'icontag'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'dt'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'captiontag'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'dd'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'columns'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'size'</span> &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'thumbnail'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'include'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'exclude'</span> &nbsp; &nbsp;<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">''</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/intval"><span style="color: #990000;">intval</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'RAND'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$order</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$orderby</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'none'</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$include</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$include</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'/[^0-9,]+/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$include</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$_attachments</span> <span style="color: #339933;">=</span> get_posts<span style="color: #009900;">&#40;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$include</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_status'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'inherit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$order</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$orderby</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$val</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$val</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>ID<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$exclude</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$exclude</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'/[^0-9,]+/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$exclude</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> get_children<span style="color: #009900;">&#40;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'exclude'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$exclude</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_status'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'inherit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$order</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$orderby</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> get_children<span style="color: #009900;">&#40;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_status'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'inherit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$order</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$orderby</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$att_id</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$attachment</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> wp_get_attachment_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$att_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</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: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$itemtag</span> <span style="color: #339933;">=</span> tag_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$itemtag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$captiontag</span> <span style="color: #339933;">=</span> tag_escape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$captiontag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$columns</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/intval"><span style="color: #990000;">intval</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$itemwidth</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$columns</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span> ? <a href="http://www.php.net/floor"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">/</span><span style="color: #000088;">$columns</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$float</span> <span style="color: #339933;">=</span> is_rtl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'right'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'left'</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$selector</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;gallery-<span style="color: #006699; font-weight: bold;">{$instance}</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gallery_style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<br />
&lt;div id=&quot;</span><span style="color: #000088;">$selector</span><span style="color: #0000ff;">&quot; class=&quot;</span>gallery galleryid<span style="color: #339933;">-</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot;&gt;<br />
&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$attachment</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #0000ff;">'file'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span> ? wp_get_attachment_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> wp_get_attachment_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&amp;lt;<span style="color: #006699; font-weight: bold;">{$itemtag}</span> class='gallery-item'&amp;gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;lt;<span style="color: #006699; font-weight: bold;">{$icontag}</span> class='gallery-icon' col-<span style="color: #006699; font-weight: bold;">{$columns}</span>'&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006699; font-weight: bold;">$link</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$captiontag</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachment</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>post_excerpt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;lt;<span style="color: #006699; font-weight: bold;">{$captiontag}</span> class='gallery-caption'&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;</span> <span style="color: #339933;">.</span> wptexturize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachment</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>post_excerpt<span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$columns</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #000088;">$columns</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;<br />
<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</pre>
<h3>Your Retarded Gallery (again)</h3>
<p>I was working on a friend&#8217;s agency start up page which featured the newly renamed &#8220;Featured Image&#8221;, and needed the gallery inserted by the template file. WordPress doesn&#8217;t seem to have a <code class="codecolorer text default"><span class="text">the_gallery()</span></code> feature, and the gallery they offer contains the same Featured Image that was in use elsewhere (a portfolio thumbnail)&#8230; so I wrote a simple little php bit for my functions.php.</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> the_gallery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$thumbID</span> <span style="color: #339933;">=</span> get_post_thumbnail_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$the_gallery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'<br />
<br />
[gallery size=&quot;full&quot; columns=&quot;1&quot; link=&quot;file&quot; exclude=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$thumbID</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;]<br />
'</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> do_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$the_gallery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
</pre>
<p>While these aren&#8217;t really anything ground breaking, or all that new. These two functions are what kept that project going with WordPress and have also gotten me into the wonderful world of WordPress hooks.</p>
]]></content:encoded>
			<wfw:commentRss>http://rjackson.ca/blog/2010/08/wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear Mr Old Spice,</title>
		<link>http://rjackson.ca/blog/2010/08/mr-old-spice/</link>
		<comments>http://rjackson.ca/blog/2010/08/mr-old-spice/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 05:57:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Awesome Advertising]]></category>

		<guid isPermaLink="false">http://rjackson.ca/?p=25</guid>
		<description><![CDATA[Congratulations Mr Old Spice. I got caught up in the tales of failure others were spreading about you. They said you were no good; I couldn&#8217;t believe it. Your take on social media was brilliant. The perfect mix of big budget (well bigger than me, or the agencies I&#8217;ve worked for at least) and actual [...]]]></description>
			<content:encoded><![CDATA[<p>Congratulations Mr Old Spice. I got caught up in the tales of failure others were spreading about you. They said you were no good; I couldn&#8217;t believe it.</p>
<p><span id="more-25"></span>Your take on social media was brilliant. The perfect mix of big budget (well bigger than me, or the agencies I&#8217;ve worked for at least) and actual thought process. That was nice, and I Dugg you.</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/LWCVhGzrAT0?fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/LWCVhGzrAT0?fs=1" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a title="The Agency" href="http://www.wk.com/">Wieden + Kennedy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rjackson.ca/blog/2010/08/mr-old-spice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The shortest pitch</title>
		<link>http://rjackson.ca/blog/2010/06/the-shortest-pitch/</link>
		<comments>http://rjackson.ca/blog/2010/06/the-shortest-pitch/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 17:36:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[pitch]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://rjackson.ca/?p=23</guid>
		<description><![CDATA[I just got a pitch today that I wanted to mention. It&#8217;s by far the best pitch I&#8217;ve seen and it was only done in 130 words. Every day I see people do the opposite every day, saying less in more. Ryan: here&#8217;s the shortest marketing pitch you&#8217;ll ever receive Let&#8217;s face it, e-mail marketing [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a pitch today that I wanted to mention. It&#8217;s by far the best pitch I&#8217;ve seen and it was only done in 130 words. Every day I see people do the opposite every day, saying less in more.</p>
<p><span id="more-23"></span></p>
<div class="subcontent">
<h2>Ryan: here&#8217;s the shortest marketing pitch you&#8217;ll ever receive</h2>
<hr />
<p>Let&#8217;s face it, e-mail marketing is a lot like going to the dentist.</p>
<p>You don&#8217;t like getting them and we don&#8217;t like sending them.Â  But sadly, we both realize they have their place and value. But it doesn&#8217;t mean to say they can&#8217;t be short. So here&#8217;s the pitch in all its glory:</p>
<p><strong>We create measurable video and marketing communications. (for the likes of Wilfrid Laurier University, Microsoft Partners, Mattel and more). Teaser sample:</strong></p>
<p><strong>http: //www.vimeo.com/2807096<br />
http: //www.vimeo.com/2734281</strong><br />
password for both: â€¢â€¢â€¢â€¢â€¢â€¢â€¢</p>
<p>We assure you we&#8217;ve looked at your site and have some specific ideas. Call us and hold us to it. First one&#8217;s on us.</p>
<p>So, tell us. are we right? Is this the shortest pitch? If not send one on. We&#8217;d love to see it.</p>
<p>Cheers,</p>
<p>Mike Leon, MBA | Chief Brand Hero<br />
Brandheroes | 1.416.543.5292 | <a href="http://www.brandheroes.ca">www.brandheroes.ca</a></p>
</div>
<p>Every line of this pitch is perfect, at least to someoneÂ receivingÂ them and well a &#8220;little&#8221; in the industry.</p>
<p>From the start with the personalized subject line (it&#8217;s always nice to know they know our name right?), it starts to attract attention. The whole way through there is not an extra word that doesn&#8217;t have it&#8217;s place. It was so good, I over looked the less than perfect creative and emailed him back, asking about it.</p>
<blockquote><p>Took a while actually. Â I spent many years on your side of the desk and I know what it&#8217;s like to get slammed with a ton of sales pitches. So at the very least I wanted to write something that is sensitive of your time and might raise an eye brow or two in the process.</p>
<p>Really glad you liked it. Â Just sent these out for the first time ever today. But good response so far.</p></blockquote>
<p>I did like itâ€”not the Papyrus in the videoâ€”but depending on the price point, we now have a relationship.</p>
]]></content:encoded>
			<wfw:commentRss>http://rjackson.ca/blog/2010/06/the-shortest-pitch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
