<?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>Re-Cycled Air</title>
	<atom:link href="http://www.re-cycledair.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.re-cycledair.com</link>
	<description>Wordpress and PHP Tutorials</description>
	<lastBuildDate>Thu, 02 Sep 2010 23:58:47 +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>How to Enable WordPress 3 Custom Menus</title>
		<link>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus</link>
		<comments>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus#comments</comments>
		<pubDate>Thu, 02 Sep 2010 23:58:47 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[custom menus]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=672</guid>
		<description><![CDATA[Prior to WordPress 3, if you wanted custom menus you had to code them yourself.  This generally involved editing your theme&#8217;s header.php file, knowledge of HTML, CSS, PHP, and probably SQL too.  Unsuprisingly, easy custom menus was a highly requested feature for WordPress 3 and it was delivered. Unfortunately, most themes don&#8217;t have support for [...]]]></description>
			<content:encoded><![CDATA[<p>Prior to WordPress 3, if you wanted custom menus you had to code them yourself.  This generally involved editing your theme&#8217;s <em>header.php</em> file, knowledge of HTML, CSS, PHP, and probably SQL too.  Unsuprisingly,<strong> </strong>easy custom menus was a highly requested feature for WordPress 3 and it was delivered.</p>
<p>Unfortunately, most themes don&#8217;t have support for custom menus yet.  Wordpress makes it easy to add them as widgets, but if you want real menus, they need to be enabled in your theme.</p>
<h2>Step 1:  Enable Custom Menus</h2>
<p>The first thing that you need to do in order to get custom menus working in WordPress 3 is enable them.  To do that, open up your theme&#8217;s <em>functions.php</em> file, and drop in the following code.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> register_custom_menu<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
register_nav_menu<span class="phpOperator">(</span><span class="phpString">'custom_menu'</span>, __<span class="phpOperator">(</span><span class="phpString">'Custom Menu'</span><span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
add_action<span class="phpOperator">(</span><span class="phpString">'init'</span>, <span class="phpString">'register_custom_menu'</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>Once you have done that, go to Appearance -&gt; Menus and you should see something like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/09/theme_locations.jpg" rel="lightbox[672]"><img class="aligncenter size-full wp-image-677" title="Wordpress Custom Menu Theme Locations" src="http://www.re-cycledair.com/wp-content/uploads/2010/09/theme_locations.jpg" alt="Wordpress Custom Menu Theme Locations" width="287" height="177" /></a></p>
<h2>Step 2:  Add the Menu to Your Theme</h2>
<p>Assuming that you&#8217;ve created a custom menu and want to display it, you&#8217;ll need to add the display function to your theme.  In most cases, you&#8217;ll need to open up the <em>header.php</em> file, and the area that looks like a menu.  This changes for every theme, but it should be fairly obvious.  Once you find it, insert the following code.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span><span class="htmlText"> wp_nav_menu</span><span class="phpOperator">(</span><span class="phpFunction">array</span><span class="phpOperator">(</span><span class="phpString">'menu'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> <span class="phpString">'custom_menu'</span><span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpText">;</span> <span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>After that, you&#8217;re menu should display in your navigation bar.  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Exclude WordPress Plugins From Updates</title>
		<link>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates</link>
		<comments>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates#comments</comments>
		<pubDate>Mon, 30 Aug 2010 22:15:14 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=662</guid>
		<description><![CDATA[More often then we would like to admit, we are unwilling or unable to submit our WordPress plugins back to the repository for everyone to use.  But how do you exclude your plugin from WordPress updates?  As usual, the answer is with filters.  Check out the code below to see how. function exclude_my_plugin( $r, $url [...]]]></description>
			<content:encoded><![CDATA[<p>More often then we would like to admit, we are unwilling or unable to submit our WordPress plugins back to the repository for everyone to use.  But how do you exclude your plugin from WordPress updates?  As usual, the answer is with filters.  Check out the code below to see how.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> exclude_my_plugin<span class="phpOperator">(</span> $r, $url <span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span> <span class="phpNumber">0</span> <span class="phpOperator">!</span><span class="phpOperator"><span class="phpOperator">=</span>=</span> <span class="phpFunction">strpos</span><span class="phpOperator">(</span> $url, <span class="phpString">'http<span class="phpOperator">:</span><span class="phpComment">//api<span class="phpOperator">.</span>wordpress<span class="phpOperator">.</span>org/plugins/update-check'</span> <span class="phpOperator">)</span> <span class="phpOperator">)</span>
</span>>return $r<span class="phpText">;</span>
$plugins <span class="phpOperator">=</span> <span class="phpFunction">un<span class="phpFunction">serialize</span></span><span class="phpOperator">(</span> $r<span class="phpOperator">[</span><span class="phpString">'body'</span><span class="phpOperator">]</span><span class="phpOperator">[</span><span class="phpString">'plugins'</span><span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">unset</span><span class="phpOperator">(</span> $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>plugins<span class="phpOperator">[</span> plugin_basename<span class="phpOperator">(</span> <span class="phpConstant">__FILE__</span> <span class="phpOperator">)</span> <span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">unset</span><span class="phpOperator">(</span> $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>active<span class="phpOperator">[</span> <span class="phpFunction">array_search</span><span class="phpOperator">(</span> plugin_basename<span class="phpOperator">(</span> <span class="phpConstant">__FILE__</span> <span class="phpOperator">)</span>, $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>active <span class="phpOperator">)</span> <span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
$r<span class="phpOperator">[</span><span class="phpString">'body'</span><span class="phpOperator">]</span><span class="phpOperator">[</span><span class="phpString">'plugins'</span><span class="phpOperator">]</span> <span class="phpOperator">=</span> <span class="phpFunction">serialize</span><span class="phpOperator">(</span> $plugins <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
return </span>$r<span class="phpText">;</span>
<span class="phpOperator">}</span>
add_filter<span class="phpOperator">(</span> <span class="phpString">'http_request_args'</span>, <span class="phpString">'exclude_my_plugin'</span>, <span class="phpNumber">5</span>, <span class="phpNumber">2</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p><span style="font-size: small"><em><span style="font-size: x-small">Attribute:  This code is originally from a lead WordPress Developer, <a href="http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/">Mark Jaquith </a>(thanks Mark!</span>)</em></span></p>
<p>But how does this exclude your plugin from the update?  First, it takes the HTTP Request args and unserializes the ['body']['plugins'] part of it.  From there, it&#8217;s as simple as unsetting your plugin from the array, then re-serializing the request args.  Also the first part checks to see if this is actually and update check.  If it&#8217;s not, you exit the function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Enable Custom Backgrounds in WordPress 3</title>
		<link>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3</link>
		<comments>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3#comments</comments>
		<pubDate>Sun, 29 Aug 2010 04:34:35 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=651</guid>
		<description><![CDATA[One of the smaller (yet still welcome) features that snuck it&#8217;s way into WordPress 3 was custom backgrounds.  In most cases, this allows you to change the background picture and color of your blog (Note:  This may not work if your theme has a background already).  This is great, because you don&#8217;t have to know [...]]]></description>
			<content:encoded><![CDATA[<p>One of the smaller (yet still welcome) features that snuck it&#8217;s way into WordPress 3 was <strong>custom backgrounds</strong>.  In most cases, this allows you to change the background picture and color of your blog (<em>Note:  This may not work if your theme has a background already</em>).  This is great, because you don&#8217;t have to know CSS to make it work.  Really, all you need to do is add the following code to your theme&#8217;s <em>functions.php</em> file.</p>
<pre class="php">
add_custom_background<span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>After that, under the Appearance menu you should have a &#8220;Background&#8221; option link.  When clicked, it will look like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/custom_background.jpg" rel="lightbox[651]"><img class="aligncenter size-medium wp-image-652" title="Wordpress 3 Custom Backgrounds" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/custom_background-300x179.jpg" alt="Enable WordPress 3 Custom Backgrounds" width="300" height="179" /></a></p>
<p>From there, upload your custom background and bask in your own glory!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Keyword Tool</title>
		<link>http://www.re-cycledair.com/google-keyword-tool</link>
		<comments>http://www.re-cycledair.com/google-keyword-tool#comments</comments>
		<pubDate>Sat, 28 Aug 2010 14:00:06 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=645</guid>
		<description><![CDATA[It&#8217;s not easy knowing what to write about.  When you run a niche site like this, it&#8217;s even harder.  One of the tools I rely heavily on to tell whether I should invest the time writing a post or not is the Google Keyword Tool.  The Google Keyword Tool allows you enter key words, and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not easy knowing what to write about.  When you run a niche site like this, it&#8217;s even harder.  One of the tools I rely heavily on to tell whether I should invest the time writing a post or not is the <a href="https://adwords.google.com/select/KeywordToolExternal"><strong>Google Keyword Tool</strong></a>.  The <a href="https://adwords.google.com/select/KeywordToolExternal"><strong>Google Keyword Tool</strong></a> allows you enter key words, and then it tells you the monthly search volume on those words, the competition, and even monthly local searches.  But it doesn&#8217;t stop there, it gives you other keywords that may be relevant to you and displays statistics on those as well.   By far though, the most important feature is the competition rating.  It lets you see if you should even bother trying to go after that niche or not.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/keywords.jpg" rel="lightbox[645]"><img class="aligncenter size-full wp-image-646" title="Google Keyword Tool" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/keywords.jpg" alt="Google Keyword Tool" width="408" height="126" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/google-keyword-tool/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Lightbox</title>
		<link>http://www.re-cycledair.com/wordpress-lightbox</link>
		<comments>http://www.re-cycledair.com/wordpress-lightbox#comments</comments>
		<pubDate>Sat, 28 Aug 2010 12:00:41 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=643</guid>
		<description><![CDATA[The default behavior in WordPress when an image is clicked is to open another page of your blog.  Sometimes though, you want a more elegant solution.  One of the more trendy ways to open an image of the past few years has been using something called a lightbox.  A lightbox dims the screen via a [...]]]></description>
			<content:encoded><![CDATA[<p>The default behavior in WordPress when an image is clicked is to open another page of your blog.  Sometimes though, you want a more elegant solution.  One of the more trendy ways to open an image of the past few years has been using something called a <strong>lightbox</strong>.  A lightbox dims the screen via a modal window, and then displays your image.  If you would like something of this nature to be your default image behavior, check out <strong>Lightbox 2 </strong>(<a href="http://wordpress.org/extend/plugins/lightbox-2/">http://wordpress.org/extend/plugins/lightbox-2/</a>).  Don&#8217;t just take my word for it though, try out this WordPress lightbox by clicking the image below.</p>
<div id="attachment_611" class="wp-caption aligncenter" style="width: 286px"><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM.png" rel="lightbox[643]"><img class="size-full wp-image-611" title="Digg Oregon Trail Error Page" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM.png" alt="Wordpress Lightbox Example" width="276" height="132" /></a><p class="wp-caption-text">Test Lightbox Image</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/wordpress-lightbox/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Create and Code WordPress Widgets</title>
		<link>http://www.re-cycledair.com/create-and-code-wordpress-widgets</link>
		<comments>http://www.re-cycledair.com/create-and-code-wordpress-widgets#comments</comments>
		<pubDate>Sat, 28 Aug 2010 00:49:23 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=630</guid>
		<description><![CDATA[Note:  The full source code for this plugin can be found here. Every time you go to WordPress blog and see items in the sidebar, it&#8217;s likely that they are widgets.  There are thousands of them for download on WordPress.org, but what if you want to create your own?  How would you code it? That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div>
<p><em>Note:  The full source code for this plugin can be found <a href="../wp-content/uploads/2010/08/sweet_math_widget.zip">here.</a></em></p>
<p>Every time you go to WordPress blog and see items in the sidebar, it&#8217;s likely that they are widgets.  There are thousands of them for download on WordPress.org, but what if you want to create your own?  How would you code it? That&#8217;s what I will answer in this quick How-To.</p>
</div>
<div>
<h3><strong>Step 1:  Create The Plugin</strong></h3>
<p><strong> </strong>We&#8217;re going to start out by creating a simple plugin.  It&#8217;s only purpose is to initialize our widget.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpComment">/*
Plugin Name<span class="phpOperator">:</span> Sweet Math Widget
Plugin URI<span class="phpOperator">:</span><span class="htmlText"> http</span><span class="phpOperator">:</span><span class="phpComment">//www<span class="phpOperator">.</span>re-cycledair.com
</span><span class="htmlText">Description</span><span class="phpOperator">:</span><span class="htmlText"> A math widget that takes the post id and multiplies it by </span><span class="phpNumber">5</span><span class="phpOperator">.</span>
<span class="htmlText">
Author</span><span class="phpOperator">:</span> Jack Slingerland
Version<span class="phpOperator">:</span> <span class="phpNumber">0</span><span class="phpOperator">.</span><span class="phpNumber">1</span>
<span class="htmlText">
Author URI</span><span class="phpOperator">:</span><span class="htmlText"> http</span><span class="phpOperator">:</span><span class="phpComment">//www<span class="phpOperator">.</span>re-cycledair.com
</span>*/</span>
<span class="phpFunctionKeyword">function</span><span class="htmlText"> sweetMathWidget</span><span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
global </span>$post;
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">{</span>$post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span><span class="htmlText">ID</span><span class="phpOperator">}</span><span class="htmlText"> x </span><span class="phpNumber">5</span> <span class="phpOperator">=</span> "</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID*<span class="phpNumber">5</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<h3><strong>Step 2:  Add &amp; Register the Widget</strong></h3>
<p>The nex step is the add the widget to WordPress and then register it.  Add this code to the plugin that you already have going.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> sweetMathWidgetInit<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
register_sidebar_widget<span class="phpOperator">(</span>__<span class="phpOperator">(</span><span class="phpString">'Sweet Math Widget'</span><span class="phpOperator">)</span>, <span class="phpString">'sweetMathWidget'</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
add_action<span class="phpOperator">(</span><span class="phpString">"plugins_loaded"</span>, <span class="phpString">"sweetMathWidgetInit"</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<h3><strong>Step 3:  Add Theme Compatibility</strong></h3>
<p>You want everyone you use your plugin right?  Well if it isn&#8217;t compatible with any themes nobody is going to use it.  To add theme compatibility we need to modify the first function we wrote to look like this.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> sweetMathWidget<span class="phpOperator">(</span>$args<span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
global </span>$post;
<span class="phpFunction">extract</span><span class="phpOperator">(</span>$args<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $before_widget;
<span class="phpFunction">echo</span> $before_title<span class="phpText">;</span>
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">&lt;</span>h2<span class="phpOperator">&gt;</span> Sweet Math Widget <span class="phpOperator">&lt;</span>/h2<span class="phpOperator">&gt;</span>"</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $after_title<span class="phpText">;</span>
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">{</span>$post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID<span class="phpOperator">}</span> x <span class="phpNumber">5</span> <span class="phpOperator">=</span> "</span><span class="phpText">;</span><span class="phpFunction">echo</span> $post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID*<span class="phpNumber">5</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $after_widget;
<span class="phpOperator">}</span>
</pre>
<h3><strong>Step 4:  Upload &amp; Add The Widget</strong></h3>
<p>Now that you&#8217;re done, save the file as sweet_math_widget.php and then zip the file using WinZip (or a similar tool).  Upload the plugin to your WordPress install and then activate.  If everything goes well, you&#8217;ll have a new widget in you Appearance -&gt; Widgets area.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/math_widget_picture.jpg" rel="lightbox[630]"><img class="aligncenter size-full wp-image-634" title="Sweet Math Widget" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/math_widget_picture.jpg" alt="How to Create / Code A WordPress Widget" width="489" height="248" /></a></p>
<p>Drag &#8220;Sweet Math Widget into your sidebar and you&#8217;re done.  Go to a post on your blog and you should see something like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/final_product.jpg" rel="lightbox[630]"><img class="aligncenter size-full wp-image-636" title="Final Product" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/final_product.jpg" alt="How to Create / Code a WordPress Widget Final Product" width="298" height="117" /></a></p>
<p>You can download the full source code for this widget <a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/sweet_math_widget.zip">here.</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/create-and-code-wordpress-widgets/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Enable Post Thumbnails In WordPress</title>
		<link>http://www.re-cycledair.com/how-to-enable-post-thumbnails-in-wordpress</link>
		<comments>http://www.re-cycledair.com/how-to-enable-post-thumbnails-in-wordpress#comments</comments>
		<pubDate>Thu, 26 Aug 2010 23:00:52 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=615</guid>
		<description><![CDATA[Since version 2.9 of WordPress, it&#8217;s been possible to have post thumbnails.  Once these thumbnails have been set, they can be used throughout your site whenever your post is called.  Using post thumbnails is easy, and so is enabling them.  It&#8217;s only a few steps, so let&#8217;s get started. Enable The first step to using [...]]]></description>
			<content:encoded><![CDATA[<p>Since version 2.9 of WordPress, it&#8217;s been possible to have post thumbnails.  Once these thumbnails have been set, they can be used throughout your site whenever your post is called.  Using post thumbnails is easy, and so is enabling them.  It&#8217;s only a few steps, so let&#8217;s get started.</p>
<h2>Enable</h2>
<p>The first step to using post thumbnails in WordPress is to enable them.  To do that, all you need to do is put the following in you themes <em>functions.php</em> file.</p>
<pre class="php">add_theme_support<span class="phpOperator">(</span><span class="phpString">'post-thumbnails'</span><span class="phpOperator">)</span><span class="phpText">;</span></pre>
<p>Once you&#8217;ve added this code, you should see a box underneath &#8220;Post Tags&#8221; in the Edit Post screen.</p>
<h2><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/featured_images.jpg" rel="lightbox[615]"><img class="aligncenter size-full wp-image-617" title="Post Thumbnail Box" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/featured_images.jpg" alt="Post Thumbnail Box" width="295" height="74" /></a></h2>
<h2>Set the Post Thumbnail</h2>
<p>Now that you have the featured image box in you WordPress Edit Post area, you need to click the &#8220;Set featured image&#8221; link.  Once you do that, you&#8217;ll be greeted with the usual WordPress image upload screen.  Select the image you would like to upload, and then let WordPress do it&#8217;s image crunching magic.  Now comes the most important part, you need need to click &#8220;Use as featured image&#8221;.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/use_featured_image.jpg" rel="lightbox[615]"><img class="aligncenter size-full wp-image-619" title="Use Post Thumbnail" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/use_featured_image.jpg" alt="Use Post Thumbnail" width="492" height="342" /><br />
</a>Once you&#8217;ve done that, you&#8217;ll get a thumbnail version of the photo you just uploaded in the lower-right hand corner of you Edit Posts screen.</p>
<h2><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/thumbnail_set.jpg" rel="lightbox[615]"><img class="aligncenter size-full wp-image-620" title="Post Thumbnail Set" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/thumbnail_set.jpg" alt="Post Thumbnail Set" width="300" height="276" /></a></h2>
<h2><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/thumbnail_set.jpg" rel="lightbox[615]"></a>Using Post Thumbnails in Your Theme</h2>
<p>Obviously post thumbnails aren&#8217;t much use to you if nobody can see them.  To see them in your theme, you need to call the following function while inside The Loop.</p>
<pre class="php"> <span class="htmlOtherTag">&lt;? the_post_thumbnail(); ?&gt;</span> </pre>
<p>That&#8217;s it!  It&#8217;s now easier than ever you have each one of your posts have a thumbnail.  If you have any questions, please leave them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-enable-post-thumbnails-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Digg Error Page</title>
		<link>http://www.re-cycledair.com/new-digg-error-page</link>
		<comments>http://www.re-cycledair.com/new-digg-error-page#comments</comments>
		<pubDate>Thu, 26 Aug 2010 11:56:56 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[error pages]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=610</guid>
		<description><![CDATA[I was recently checking out the new version of Digg, when I hit their error page. Nice job leveraging Oregon Trail guys.]]></description>
			<content:encoded><![CDATA[<p>I was recently checking out the new version of Digg, when I hit their error page.</p>
<div id="attachment_611" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM.png" rel="lightbox[610]"><img class="size-medium wp-image-611" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM-300x143.png" alt="" width="300" height="143" /></a><p class="wp-caption-text">Digg Oregon Train Error Page (click to enlarge)</p></div>
<p style="text-align: center">Nice job leveraging Oregon Trail guys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/new-digg-error-page/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Shortcode Tutorial</title>
		<link>http://www.re-cycledair.com/wordpress-shortcode</link>
		<comments>http://www.re-cycledair.com/wordpress-shortcode#comments</comments>
		<pubDate>Thu, 26 Aug 2010 00:00:12 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=600</guid>
		<description><![CDATA[One neat feature of WordPress plugins is shortcode.  Shortcode enables a user to put something like &#8220;[myplugin]&#8221; in their posts or pages and have it display content from their plugin.  Making WordPress shortcode work for you isn&#8217;t terribly difficult, but without some help it can be confusing.  In this tutorial, I&#8217;ll show you how to [...]]]></description>
			<content:encoded><![CDATA[<p>One neat feature of WordPress plugins is shortcode.  Shortcode enables a user to put something like &#8220;[myplugin]&#8221; in their posts or pages and have it display content from their plugin.  Making WordPress shortcode work for you isn&#8217;t terribly difficult, but without some help it can be confusing.  In this tutorial, I&#8217;ll show you how to use shortcode in your plugins.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> content_myshortcode<span class="phpOperator">(</span>$content<span class="phpOperator">)</span>
<span class="phpOperator">{</span>
<span class="phpKeyword">
if<span class="phpOperator">(</span></span><span class="phpFunction">preg_match</span><span class="phpOperator">(</span><span class="phpString">'/<span class="phpOperator">&lt;</span><span class="phpOperator">!</span>--myshortcode<span class="phpOperator">[</span>\<span class="phpOperator">(</span><span class="phpOperator">]</span>*<span class="phpOperator">(</span>.*<span class="phpOperator">?</span><span class="phpOperator">)</span><span class="phpOperator">[</span>\<span class="phpOperator">)</span><span class="phpOperator">]</span>*-<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>/'</span>,$content,$matches<span class="phpOperator">)</span><span class="phpOperator">)</span>
<span class="phpOperator">{</span>
$parameter1 <span class="phpOperator">=</span> $matches<span class="phpOperator">[</span><span class="phpNumber">1</span><span class="phpOperator">]</span><span class="phpText">;</span>
$content <span class="phpOperator">=</span> <span class="phpFunction">preg_replace</span><span class="phpOperator">(</span><span class="phpString">'/<span class="phpOperator">&lt;</span><span class="phpOperator">!</span>--myshortcode<span class="phpOperator">(</span>.*<span class="phpOperator">?</span><span class="phpOperator">)</span>-<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>/'</span>,myshortcode<span class="phpKeyword"><span class="phpOperator">(</span>false,</span>$parameter1<span class="phpOperator">)</span>, $content<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpKeyword">
return </span>$content;
<span class="phpOperator">}</span>
</pre>
<p>Now what does this do?  This function will go through the content of your post/page, and look for the &lt;!&#8211;myshortcode&#8211;&gt; shortcode.  If it finds it, it will then call the &#8220;myshortcode()&#8221; function in your plugin and put it&#8217;s content there.  Now, this doesn&#8217;t happen automatically.  As with most WordPress development, we need to add a filter.</p>
<pre class="php">
add_filter<span class="phpOperator">(</span><span class="phpString">'the_content'</span>, <span class="phpString">'content_wacoverages'</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/wordpress-shortcode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Database Query Using The WPDB Class</title>
		<link>http://www.re-cycledair.com/wordpress-database-query-using-wpdb-class</link>
		<comments>http://www.re-cycledair.com/wordpress-database-query-using-wpdb-class#comments</comments>
		<pubDate>Tue, 24 Aug 2010 23:29:07 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wpdb]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=576</guid>
		<description><![CDATA[As a plugin developer or WordPress hacker, accessing the database used by a WordPress install is vital.  This can be accomplished through a few different means, but the best is by using the WPDB class that is provided.  The only requirement for using this class is that your code exists within the WordPress install (plugins, [...]]]></description>
			<content:encoded><![CDATA[<p>As a plugin developer or WordPress hacker, accessing the database used by a WordPress install is vital.  This can be accomplished through a few different means, but the best is by using the WPDB class that is provided.  The only requirement for using this class is that your code exists within the WordPress install (plugins, themes, etc).</p>
<p><strong>WPDB Queries</strong></p>
<p>Let&#8217;s say that you would like to run a simple query that returns all of the rows in the &#8220;posts&#8221; table.  With the WPDB class, all you need to do is execute:</p>
<pre class="php">$rows <span class="phpOperator">=</span> $wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>get_results<span class="phpOperator">(</span> <span class="phpString">"SELECT * FROM $wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>posts"</span> <span class="phpOperator">)</span><span class="phpText">;</span></pre>
<p>When this code is executed, it returns the entire table &#8220;posts&#8221; (<em>$wpdb-&gt;posts</em>) as an array of objects into the <em>$rows</em> variable.  From there, it&#8217;s easy enough to iterate over the array using a foreach loop.</p>
<p><strong>WPDB Insert</strong></p>
<p>Inserting data into a table is easy using the WPDB class.  All you need to know are the column name(s), the table name, and data you want to store.  I&#8217;ll lead with an example:</p>
<pre class="php">$wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>insert<span class="phpOperator">(</span> <span class="phpString">'links'</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'link_url'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> <span class="phpString">'re-cycledair.com'</span>, <span class="phpString">'visit'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> 12 <span class="phpOperator">)</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'%s'</span>, <span class="phpString">'%d'</span> <span class="phpOperator">)</span> <span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>This example of <em>$wpdb-&gt;insert</em>, inserts &#8220;re-cycledair.com&#8221; and &#8220;12&#8243; into the <em>link_url </em>and <em>visit</em> columns of the &#8220;links&#8221; table respectively.  The third argument in this function is one that tells the WPDB what type these values are.  The first value is a string, so we use &#8220;%s&#8221;, and the second is an integer, so we use &#8220;%d&#8221;.</p>
<p>If you would like to know the auto-incremented id of this insert, simply call:</p>
<pre class="php">$wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>insert_id</pre>
<p><strong>WPDB Update</strong></p>
<p>Updating rows in a table is also easy with the WPDB class.  Here is an example of an update.</p>
<pre class="php">$wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>update<span class="phpOperator">(</span> <span class="phpString">'links'</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'link_url'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> <span class="phpString">'wordpress<span class="phpOperator">.</span>org'</span><span class="phpOperator">)</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'ID'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> 15<span class="phpOperator">)</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'%s'</span><span class="phpOperator">)</span>, <span class="phpFunction">array</span><span class="phpOperator">(</span> <span class="phpString">'%d'</span> <span class="phpOperator">)</span> <span class="phpOperator">)</span>
</pre>
<p>As you can see, this works a lot like <em>$wpdb-&gt;insert</em>.  The first argument is the table name.  The second argument is an array of column-value pairs.  The third argument is the where condition (if ID is equal to 15).  The fourth argument tells the WPDB class that you are updating a string, and the fifth argument says the WHERE condition is an integer.</p>
<p><strong>WPDB Prepare: Protect Against SQL Injection</strong></p>
<p>One thing every WordPress developer needs to know about is SQL injection.  SQL injection is when someone is able to modify your SQL query to execute their own.  To prevent this kind of malicious attack, the WPDB class has a method called &#8220;prepare&#8221;.  &#8220;Prepare&#8221; will take your input data an sanitize it, so that it cannot be used in a SQL injection attack.  An example is as follows:</p>
<pre class="php">$wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>query<span class="phpOperator">(</span> $wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>prepare<span class="phpOperator">(</span> <span class="phpString">"
	INSERT INTO $wpdb<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>posts
	<span class="phpOperator">(</span> post_id, post_content <span class="phpOperator">)</span>
	VALUES <span class="phpOperator">(</span> %d, %s<span class="phpOperator">)</span>"</span>,
        15, <span class="phpString">"this is un&#039;safe"</span> <span class="phpOperator">)</span> <span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>As with previous examples, the &#8220;%d&#8221; and &#8220;%s&#8221; function as placeholders for the sanitized data.</p>
<p>With those functions and a little bit of work, you should be writing WordPress database queries with the WPDB class in no time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/wordpress-database-query-using-wpdb-class/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.393 seconds -->
<!-- Cached page served by WP-Cache -->
