<?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>WPCanada&#187; Tutorials</title>
	<atom:link href="http://wpcanada.ca/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpcanada.ca</link>
	<description>in the great white north</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:21:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building a Tweet Archive On Genesis</title>
		<link>http://wpcanada.ca/2011/building-a-tweet-archive-on-genesis/</link>
		<comments>http://wpcanada.ca/2011/building-a-tweet-archive-on-genesis/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 09:15:41 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2812</guid>
		<description><![CDATA[Last year Leland of ThemeLab posted a tutorial on building a personal tweet archive powered by WordPress. He even went so far as to create a theme for use with this archive which was released free of charge. The idea intrigued me and so off I went to build my own archive. Following Leland's instructions [...]]]></description>
			<content:encoded><![CDATA[<p>Last year Leland of ThemeLab <a href="http://www.themelab.com/2010/06/15/wordpress-tweet-archive/" title="ThemeLab">posted</a> a tutorial on building a personal tweet archive powered by WordPress. He even went so far as to <a href="http://www.themelab.com/2010/08/25/tl-tweets-free-wordpress-theme/" title="ThemeLab">create a theme</a> for use with this archive which was released free of charge.</p>
<p>The idea intrigued me and so off I went to build my own archive. Following Leland's instructions I had the site up and running in less than half hour with a modified version of his free TL Tweets theme.</p>
<p>After a few months of the archive going live I decided to convert it to the Genesis framework for 2 reasons:</p>
<ol>
<li>To see if I could do it</li>
<li>I'm a huge fan of Genesis</li>
</ol>
<p>Surprisingly the process was much easier than I initially thought it would be. I simply had to study the construction of Leland's theme and adapt that to Genesis. After a few unfortunate mishaps (it blowed up real good) I got the result I wanted.</p>
<p>In this post I won't cover how to build the tweet archive itself as Leland has already done that. What I will do is show you the steps I took on getting this archive to run on Genesis.</p>
<h3>The Tools</h3>
<ul>
<li><a href="http://www.studiopress.com/plugins/simple-hooks" title="Genesis Simple Hooks by StudioPress">Genesis Simple Hooks</a> by StudioPress</li>
<li><a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework by StudioPress">Genesis Framework</a> by StudioPress</li>
<li>Genesis child theme</li>
</ul>
<p>The process I used was a combination of the Genesis Simple Hooks plugin and edits to the child theme's <code>functions.php</code> file. For my own archive I chose the Minimum child theme for its crisp and clean appearance.</p>
<h3>Genesis Simple Hooks</h3>
<p>First, grab a copy of the plugin. Once activated it will create a submenu under the Genesis menu in the sidebar. Navigate to Genesis &gt; Simple Hooks and scroll down to the meta box called Post/Page Hooks. Once you find it scroll down a bit farther to locate the genesis_post_title Hook. You will see an option that asks Unhook genesis_do_post_title() function from this hook? Place a check mark in the box. Take a look at the screenshot below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/09/unhook_function.png" alt="Unhook genesis_do_post_title()" title="Unhook genesis_do_post_title()" width="400" height="273" class="aligncenter size-full wp-image-2813" /></p>
<p>As you might have guessed this will unhook genesis_do_post_title() thereby preventing its output. We don't need post titles for our tweets.</p>
<p>Now, I wanted a way whereby I could output the date/time of the post directly beneath the post then turn that into a permalink. Here's how I did it.</p>
<p>Go back to the Post/Page Hooks meta box and look for the section genesis_after_post_content Hook. You will see an option that asks Unhook genesis_post_meta() function from this hook? Place a check in the box. You will see another option that asks Execute PHP on this hook? Check that box as well. In the text area enter the following.</p>
<p><code>
<pre>&lt;?php if (is_page() || is_single()) : ?&gt;
&lt;?php else : ?&gt;
&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;&lt;?php the_time('M jS Y') ?&gt;&lt;/a&gt; &lt;?php edit_post_link('edit', '', ''); ?&gt;
&lt;?php endif; ?&gt;</pre>
<p></code></p>
<p>Have a look at the screenshot below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/09/execute_php.png" alt="Unhook genesis_post_meta() and execute PHP" title="Unhook genesis_post_meta() and execute PHP" width="500" height="325" class="aligncenter size-full wp-image-2815" /></p>
<p>What we have done is unhooked the genesis_post_meta() function then elected to execute some PHP. This will prevent the default output from appearing in favour of our own PHP.</p>
<p>I used the_time() and wrapped it inside the_permalink(). I also threw in a edit_post_link() because I wanted it but it's not necessary. I then wrapped the entire bit with a conditional because I didn't want it to appear on pages or single post pages. That takes care of that.</p>
<p>But wait! We now have the post date appearing twice because Genesis already outputs this via the genesis_post_info() function.</p>
<p>No problem. Once again go to the Post/Page Hooks meta box and look for the section genesis_before_post_content Hook. There will be an option that asks Unhook genesis_post_info() function from this hook? Place a tick in the box. This will prevent that function from firing. Have a look at the screenshot below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/09/unhook_post_info.png" alt="Unhook genesis_post_info()" title="Unhook genesis_post_info()" width="500" height="267" class="aligncenter size-full wp-image-2816" /></p>
<p>We're now finished configuring the plugin options. Off to the child theme's <code>functions.php</code> file.</p>
<h3>Editing functions.php file</h3>
<p>This goes without saying but I'll say it anyway, make sure you are editing the child theme's <code>functions.php</code> file and not the Genesis file. All edits should be made to the child theme.</p>
<p>To add pagination to individual post pages add the following to the child theme's <code>functions.php</code> file.</p>
<p><code>
<pre>// Add pagination to single post
add_action('genesis_after_post_content', 'custom_post_nav');
function custom_post_nav(){
if (is_single()) {?&gt;
&lt;div class="post-nav"&gt;
&lt;div class="next-post-nav"&gt;
&lt;?php next_post_link('%link', 'Next Post &raquo;'); ?&gt;
&lt;/div&gt;
&lt;div class="prev-post-nav"&gt;
&lt;?php previous_post_link('%link', '&laquo; Previous Post'); ?&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;?php
}}</pre>
<p></code></p>
<p>What we've done here is created a new function called custom_post_nav() and hooked it into the genesis_after_post_content hook. Then we wrapped it in a conditional so that it appears only on single post pages.</p>
<p>To style it I added the following to the child theme's css file. &#42;</p>
<p><code>
<pre>.post-nav {
	overflow: auto;
	margin: 10px 0;
	padding: 5px 0;
	}

.prev-post-nav {
	float: left;
	width: 50%;
	}

.next-post-nav {
	float: right;
	width: 50%;
	text-align: right;
	}</pre>
<p></code></p>
<p>For the large font size on the single post pages I added the following to the child theme's css file. &#42;</p>
<p><code>
<pre>.single-post #content .entry-content p{
	font-size:24px;
	line-height:30px
	}</pre>
<p></code></p>
<p>That's all there is to it. Your own personal tweet archive is now powered by Genesis.</p>
<h3>Optional Steps</h3>
<p>The following steps are not necessary. They are merely extras that I wanted to incorporate into my own archive. I'll share them with you in case you want to use them.</p>
<p><strong>i Layout</strong><br />
The default layout of the Minimum child theme is content-sidebar. But I only wanted content-sidebar for the front page and any additional pages I decided to create. For single post pages, archive listings, search results etc I wanted full-width-content.</p>
<p>Here is what I did.</p>
<p>Under the Genesis Layout Options I chose full width. That selection imposes that layout site-wide. Then I added the following to the child theme's <code>functions.php</code> file.</p>
<p><code>
<pre>/** Force layout on homepage */
add_filter('genesis_pre_get_option_site_layout', 'child_home_layout');
function child_home_layout($opt) {
	if ( is_home() )
    $opt = 'content-sidebar';
	return $opt;
}</pre>
<p></code></p>
<p>This forces the content-sidebar layout on the home page while the rest of the site remains with the full-width-content layout. But what about pages?</p>
<p>Genesis gives you the ability to choose a certain layout on a post-by-post or page-by-page basis. I like that flexibility. Using my own archive as an example, I chose the content-sidebar layout for my About page.</p>
<p><strong>ii Feeds</strong><br />
Since this is simply an archive I saw no need for RSS feeds. To disable them I added the following to the child theme's <code>functions.php</code> file.</p>
<p><code>
<pre>// Disable feeds
function fb_disable_feed() {
wp_die( __('We\'re sorry but there is no feed available for this content. Please visit our &lt;a href="'. get_bloginfo('url') .'"&gt;homepage&lt;/a&gt;!') );
}

add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);</pre>
<p></code></p>
<p>To test it try accessing one of your feed links.</p>
<h3>The Result</h3>
<p>To see an example of this in action take a look at my own tweet archive. <a href="http://tweets.wpcanada.ca" title="WPCanada Tweets">http://tweets.wpcanada.ca</a></p>
<p>&#42; Post updated 12:30PM</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/building-a-tweet-archive-on-genesis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Change User Nicename</title>
		<link>http://wpcanada.ca/2011/how-to-change-user-nicename/</link>
		<comments>http://wpcanada.ca/2011/how-to-change-user-nicename/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 05:28:46 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2787</guid>
		<description><![CDATA[One of the new security features introduced in WordPress 3.0 is the ability to select a unique name for the admin during the install process. In previous versions you only had the ability to choose a password but were stuck with the default login name of admin. While this is a welcome change it does [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new security features introduced in WordPress 3.0 is the ability to select a unique name for the admin during the install process. In previous versions you only had the ability to choose a password but were stuck with the default login name of <em>admin</em>.</p>
<p>While this is a welcome change it does have a problem. Take a look at the screenshot below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/08/login_visible.png" alt="Login name is visible" title="Login name is visible" width="567" height="321" class="aligncenter size-full wp-image-2788" /></p>
<p>It seems that when you mouseover the Author name the actual Login name is revealed in the browser tooltip at the bottom of the screen. Kind of defeats the purpose of choosing a unique login name in the first place don't you think?</p>
<p>I'll show you how to quickly fix that in a few steps.</p>
<p>First, fire up phpMyAdmin from your host's control panel and select your WordPress database. Upon doing so you will be presented with a list of the database tables. Click the browse button in the <code>wp_users</code> table. See the image below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/08/browse_button.png" alt="Click the browse button" title="Click the browse button" width="532" height="354" class="aligncenter size-full wp-image-2789" /></p>
<p>After clicking the browse button you will see the following screen. Click the pencil icon. This will allow us to edit the data contained in that row.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/08/pencil_icon.png" alt="Click the pencil icon" title="Click the pencil icon" width="579" height="280" class="aligncenter size-full wp-image-2790" /></p>
<p>After clicking the pencil icon you will see the following screen. The data we want to edit is contained within the Field called <code>user_nicename</code>. Click the image below to enlarge.</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/08/edit_nicename.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/08/edit_nicename-580x393.png" alt="Edit the user_nicename" title="Edit the user_nicename" width="580" height="393" class="aligncenter size-large wp-image-2791" /></a></p>
<p>Simply enter whatever name you want in the textarea of the <code>user_nicename</code> Field then click Go.</p>
<p>I chose to go with <em>bugsbunny</em>. Using a test site this is what it now looks like ...</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/08/new_nicename.png" alt="New user_nicename" title="New user_nicename" width="567" height="321" class="aligncenter size-full wp-image-2792" /></p>
<p>If you're not comfortable with the idea of mucking about in the database check out a plugin called <a href="http://wordpress.org/extend/plugins/edit-author-slug/" title="WordPress Plugin Directory">Edit Author Slug</a> from the WordPress Plugin Directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/how-to-change-user-nicename/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Edit Posts Link (✍)</title>
		<link>http://wpcanada.ca/2011/cool-edit-posts-link/</link>
		<comments>http://wpcanada.ca/2011/cool-edit-posts-link/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 17:17:38 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2691</guid>
		<description><![CDATA[Chris Coyier of Digging Into WordPress shows you how to spruce up those edit posts links. Actually this nifty idea could be used anywhere, such as headlines etc.]]></description>
			<content:encoded><![CDATA[<p>Chris Coyier of Digging Into WordPress shows you how to <a href="http://digwp.com/2011/06/fun-edit-posts-link/" title="Digging into WordPress">spruce up</a> those edit posts links. Actually this nifty idea could be used anywhere, such as headlines etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/cool-edit-posts-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Permalinks for Search Results: Alternative Method</title>
		<link>http://wpcanada.ca/2011/clean-permalinks-for-search-results-alternative-method/</link>
		<comments>http://wpcanada.ca/2011/clean-permalinks-for-search-results-alternative-method/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 01:55:00 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2679</guid>
		<description><![CDATA[In a post from 3 years ago I explained how to achieve "clean" permalinks for search results. (see Clean Permalinks for Search Results) While the method I detailed works quite well I stumbled upon what I think is an even better way to go about it. All that is required is a few lines of [...]]]></description>
			<content:encoded><![CDATA[<p>In a post from 3 years ago I explained how to achieve "clean" permalinks for search results. (see <a href="http://wpcanada.ca/2008/clean-permalinks-for-search-results/" title="WPCanada &raquo; Clean Permalinks for Search Results">Clean Permalinks for Search Results</a>)</p>
<p>While the method I detailed works quite well I stumbled upon what I think is an even better way to go about it. All that is required is a few lines of code in your theme's <code>functions.php</code> file.</p>
<p>Thanks to <em>Bavota San</em> for that! [<a href="http://bavotasan.com/tutorials/rewrite-search-result-url-for-wordpress/" title="bavotasan.com">link</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/clean-permalinks-for-search-results-alternative-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pagination In a Post</title>
		<link>http://wpcanada.ca/2011/pagination-in-a-post/</link>
		<comments>http://wpcanada.ca/2011/pagination-in-a-post/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 16:50:41 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2626</guid>
		<description><![CDATA[We all know that WordPress has a capability called pagination which can be applied to various pages such as your blog page, category pages, archive pages etc. Did you know that you can add pagination to a single post? This comes in handy if you have a large article, such as a tutorial, that you [...]]]></description>
			<content:encoded><![CDATA[<p>We all know that WordPress has a capability called <em>pagination</em> which can be applied to various pages such as your blog page, category pages, archive pages etc. Did you know that you can add pagination to a single post?</p>
<p>This comes in handy if you have a large article, such as a tutorial, that you want to break up into smaller segments. Simply add <code>&lt;!--nextpage--&gt;</code> to the point in your post where you want the break to occur.</p>
<p>Using the default TwentyTen theme, here is an example of a long post without pagination. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/no-pagination.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/no-pagination-209x300.png" alt="long post with no pagination" title="long post with no pagination" width="209" height="300" class="aligncenter size-medium wp-image-2627" /></a></p>
<p>Here is an example of the same long post with pagination added. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/pagination.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/pagination-300x192.png" alt="long post with pagination" title="long post with pagination" width="300" height="192" class="aligncenter size-medium wp-image-2628" /></a></p>
<p>This method breaks the post into smaller pieces making it easier to digest. Who wants to read a 5,000 word blog post on the same page right?</p>
<p>You can even dress it up further by adding subheadings etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/pagination-in-a-post/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Import or Export Your Blogroll Links Easily</title>
		<link>http://wpcanada.ca/2011/import-or-export-your-blogroll-links-easily/</link>
		<comments>http://wpcanada.ca/2011/import-or-export-your-blogroll-links-easily/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 20:56:54 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2612</guid>
		<description><![CDATA[Have you ever wondered how to import or export your blogroll links? Actually WordPress has this functionality built in but the feature is not perfect and is somewhat obscure. Using WordPress Native Functionality If you navigate to Tools &#62; Import you will see the following screen ... (click to enlarge) Referencing the image above simply [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how to import or export your blogroll links? Actually WordPress has this functionality built in but the feature is not perfect and is somewhat obscure.</p>
<h3>Using WordPress Native Functionality</h3>
<p>If you navigate to Tools &gt; Import you will see the following screen ... (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/import-blogroll.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/import-blogroll-300x92.png" alt="import blogroll" title="import blogroll" width="300" height="92" class="aligncenter size-medium wp-image-2615" /></a></p>
<p>Referencing the image above simply click on Blogroll. If you do not have the OPML importer installed you will be prompted to do so. Once installed, clicking on Blogroll will bring up the following screen shown below ... (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/specify_file.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/specify_file-300x102.png" alt="specify file" title="specify file" width="300" height="102" class="aligncenter size-medium wp-image-2616" /></a></p>
<p>Okay, we now have the ability to import an OPML file but exactly how do we <em>get</em> that OPML file? As I said the process is somewhat obscure. You can view a copy of your current blogroll links by visiting <code>http://yoursite.com/wp-links-opml.php</code>. For example, if you copy and paste <code>http://wpcanada.ca/wp-links-opml.php</code> in your browser address bar you'll see a list of my links.</p>
<p>Now go back to the previous image above. You'll see that you have 2 options:</p>
<ol>
<li>Specify an OPML URL</li>
<li>Choose from your local disk</li>
</ol>
<p>If you choose the first option simply paste <code>http://yoursite.com/wp-links-opml.php</code> in the <strong>Specify an OPML URL</strong> field. Select the category you want the links imported to and click the button marked Import OPML File.</p>
<p>If you prefer the 2nd option this is how to do it. The process varies from browser to browser but is basically the same. We'll be using Firefox for this example. As I said earlier, navigating to <code>http://yoursite.com/wp-links-opml.php</code> will bring up a list of your blogroll links. From your browser's menu select <em>Save Page As</em>. In the resulting dialogue box choose <em>Web Page, XML only</em> and save it somewhere on your hard drive. See image below. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/save-page.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/save-page-300x200.png" alt="save page as" title="save page as" width="300" height="200" class="aligncenter size-medium wp-image-2617" /></a></p>
<p>Now that you have a local copy on your machine you can import that rather than specify a URL.</p>
<p>Using the built in method does have a caveat however. When importing links, whether it be via URL or file import, you can only choose one category to assign your links to. If you have several blogroll categories you can see how this will be a problem. It means that after the import process is completed you'll have to manually re-assign your various links. This can be rather tedious if you have many links in many categories. I'll show you another method using a plugin.</p>
<h3>Using a Plugin</h3>
<p>First, grab yourself a copy of the <em>Import Blogroll With Categories</em> plugin. You can install it right from your dashboard. If you prefer the old school method <a href="http://wordpress.org/extend/plugins/import-blogroll-with-categories/" title="Import Blogroll With Categories">download</a> it from the WordPress Plugin Directory and then upload it to your site using your favourite FTP client. Once installed, activate the plugin.</p>
<p>This nifty little plugin will add two new sub-menus to your Links menu:</p>
<ul>
<li>Import</li>
<li>Export</li>
</ul>
<p>Navigating to Links &gt; Export will automatically take you to <code>http://yoursite.com/wp-links-opml.php</code> where you can save the info to your hard drive.</p>
<p>Navigating to Links &gt; Import will bring up the following screen ... (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/06/bwc-save.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/06/bwc-save-300x106.png" alt="Import Blogroll With Categories" title="Import Blogroll With Categories" width="300" height="106" class="aligncenter size-medium wp-image-2618" /></a></p>
<p>As you can see from the image above the plugin gives you the ability to create new link categories. If you have 3 link categories containing various links this option will automatically create those 3 link categories and assign the appropriate links to them. Very cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/import-or-export-your-blogroll-links-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Code in Posts Made Easy Updated</title>
		<link>http://wpcanada.ca/2011/writing-code-in-posts-made-easy-updated/</link>
		<comments>http://wpcanada.ca/2011/writing-code-in-posts-made-easy-updated/#comments</comments>
		<pubDate>Wed, 11 May 2011 19:41:52 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2520</guid>
		<description><![CDATA[Back in January I wrote about a couple of plugins that really simplified the task of writing code in blog posts. (See Writing Code in Posts Made Easy) To quickly recap, if you tend to post a lot of code in your posts you already know the problem of having your code snippets look like [...]]]></description>
			<content:encoded><![CDATA[<p>Back in January I wrote about a couple of plugins that really simplified the task of writing code in blog posts. (See <a href="http://wpcanada.ca/2011/writing-code-in-posts-made-easy/" title="WPCanada - Writing Code in Posts Made Easy">Writing Code in Posts Made Easy</a>)</p>
<p>To quickly recap, if you tend to post a lot of code in your posts you already know the problem of having your code snippets look like code snippets rather than behave like code snippets. For example, if I want to include <code>&lt;php the_content();&gt;</code> and have it display in my post as such I have to manually escape both <code>&lt;</code> and <code>&gt;</code> which means I actually have to write it as <code>&amp;lt;php the_content();&amp;gt;</code> If I don't then the code will attempt to render rather than be displayed. Since each special character has to be manually escaped you can see how quickly this can become tedious especially if you post large amounts of code.</p>
<p>The other point I talked about in the original post was adding extra buttons to your Post Editor toolbar. For example, WordPress includes a <code>code</code> button but not a <code>pre</code> button. Any time you want to use a <code>pre</code> tag you have to manually insert it.</p>
<p>In that post I highlighted 2 plugins which solved these minor problems. The bad news is they no longer work with the current version of WordPress. The good news is I found 2 replacements and yes they work since I use them here.</p>
<h3>SimpleCode</h3>
<p>Unlike Decoder Button which I highlighted in the original post this plugin does not add a button to the toolbar. What it does do is add a link to the admin menu which when clicked on takes you to a page where you can escape your code. You'll find it under Posts <code>></code> SimpleCode.</p>
<p>You'll see 2 fields - the first one is where you paste the code with the characters you need to be escaped and the second one is the generated output that you copy and paste into your blog post. See the image below. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/05/simplecode.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/05/simplecode-300x223.png" alt="SimpleCode" title="SimpleCode" width="300" height="223" class="aligncenter size-medium wp-image-2521" /></a></p>
<p>SimpleCode is simply a huge time saver. You can download it from its home at <a href="http://www.village-idiot.org/archives/2006/04/09/wp-simplecode/" title="SimpleCode">village-idiot.org</a></p>
<h3>AddQuicktag</h3>
<p>AddQuicktag is much like Post Editor Buttons which I talked about in the original post. Once activated it adds a link to the admin menu under Settings <code>></code> AddQuicktag. The link takes you to a configuration page where you can start adding your buttons. See the image below. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/05/quicktag.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/05/quicktag-300x86.png" alt="AddQuicktag" title="AddQuicktag" width="300" height="86" class="aligncenter size-medium wp-image-2522" /></a></p>
<p>All you need to do is insert the label, start tag and close tag for each button. For instance, I use a lot of h3 tags as subheaders in my posts. Rather than manually typing in <code>&lt;h3&gt;&lt;/h3&gt;</code> I now have a button on the toolbar that does it for me. I added a few extra buttons as well which allow me to quickly insert things like pullquotes or <code>pre</code> tags.</p>
<p>This is what my configuration options look like. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/05/quicktag_02.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/05/quicktag_02-300x94.png" alt="AddQuicktag Configuration" title="AddQuicktag Configuration" width="300" height="94" class="aligncenter size-medium wp-image-2523" /></a></p>
<p>And here is a screencap of my Post Editor Toolbar with the extra buttons. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/05/toolbar.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/05/toolbar-300x48.png" alt="Post Editor Toolbar" title="Post Editor Toolbar" width="300" height="48" class="aligncenter size-medium wp-image-2524" /></a></p>
<p>You can download the plugin from its home at the <a href="http://wordpress.org/extend/plugins/addquicktag/" title="AddQuicktag">WordPress Plugin Directory</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/writing-code-in-posts-made-easy-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install WordPress Locally With XAMPP Pt.2</title>
		<link>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-2/</link>
		<comments>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-2/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 09:57:48 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2355</guid>
		<description><![CDATA[This is Part 2 of a 2 part tutorial. In Part 1 of this tutorial we showed you how to install XAMPP on your PC. In this tutorial we'll show you how to get WordPress up and running. First off, head over to WordPress.org and download the latest ZIP which is 3.0.4 at the time [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-2349" title="Install WordPress Locally With XAMPP" src="http://wpcanada.ca/wp-content/uploads/2011/01/wordpress_xampp.png" alt="Install WordPress Locally With XAMPP" width="500" height="125" /></p>
<p>This is Part 2 of a 2 part tutorial.</p>
<p>In <a title="WPCanada - Install WordPress Locally With XAMPP Pt.1" href="http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-1/">Part 1</a> of this tutorial we showed you how to install XAMPP on your PC. In this tutorial we'll show you how to get WordPress up and running.</p>
<p>First off, head over to <a title="wordpress.org/download" href="http://wordpress.org/download/">WordPress.org</a> and download the latest ZIP which is 3.0.4 at the time of this writing. After you have saved it somewhere on your hard drive we need to extract the contents of the ZIP. Personally, I prefer to use <a title="www.7-zip.org" href="http://www.7-zip.org/">7-Zip</a> for this. 7-Zip is free and open source and is released under the GNU LGPL license.</p>
<p>Extract the contents of the ZIP to the <code>htdocs</code> folder which you will find at <code>C:\xampp\htdocs</code> All of your web projects will go in that folder. For example, if you want to install another package such as bbPress, Joomla, phpBB etc they all go in the <code>htdocs</code> folder. Think of it as the <code>public_html</code> folder on your host's server. Once you have extracted the ZIP you will now have a folder named wordpress inside the <code>htdocs</code> directory.</p>
<p>As a sidenote, you can rename the wordpress folder to anything you want. If you're like me and intend to run more than one instance of WordPress you'll have to. I have my folders renamed as wp01, wp02 and so forth. If you want to go with just one instance of WordPress then just leave it as it is.</p>
<p>Now we can begin. In your browser navigate to <code>http://localhost/phpmyadmin/</code> and log in. This is where we'll create the database WordPress needs in order to function. Once you log in you'll see the screen below,</p>
<p><img class="aligncenter size-full wp-image-2358" title="create database" src="http://wpcanada.ca/wp-content/uploads/2011/01/create_db.png" alt="create database" width="600" height="230" /></p>
<p>In the screen above you'll need to set a few things. Choose a name for your database. It doesn't matter what it is, for the sake of simplicity I use database names like wp01, wp02 etc to coincide with my various WordPress installs. After you have entered the name of your database you need to set both the charset and collation - go with <code>utf8_general_ci</code> When you're finished click on Create. You now have an empty database.</p>
<p>In the wordpress folder look for the <code>wp-config-sample.php</code> file and open it with a plain text editor like Notepad. The lines we will need to edit are,</p>
<pre><code>define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');</code></pre>
<p>In the first line you will enter the name of the database that you chose earlier. The second line is where you enter the username, it will be <strong>root</strong>. The third line is where you enter the database password. Using XAMPP the database password is the same password you use to log in to phpMyAdmin. Remember this paragraph from Part 1?</p>
<blockquote><p>It is in the screen above that you can set your passwords. Referencing the image above, under the heading MYSQL SECTION: ROOT PASSWORD is the password you'll need to access phpMyAdmin. Choose a password and enter it. <strong>Don't forget that password because we'll need it again later when we install WordPress</strong>. For the options entitled phpMyAdmin authentication and Set a random password for the phpMyAdmin user pma you can go with the defaults. If you want you can tick the box where it asks if you'd like to store your password in the directory shown. When you're finished click on Password Changing.</p></blockquote>
<p>Just for the sake of simplicity let's say you chose <strong>wordpress</strong> as the database name and <strong>1234</strong> as the password. The username is the default <strong>root</strong>. The lines you need to edit should now look like this,</p>
<pre><code>define('DB_NAME', 'wordpress');
define('DB_USER', 'root');
define('DB_PASSWORD', '1234');</code></pre>
<p>That's all you need to edit here. If you were installing WordPress on a live server than you would have to make further edits. You'd want to enter the various security keys in the following section,</p>
<pre><code>define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');</code></pre>
<p>You might even want to change the database prefix here,</p>
<pre><code>$table_prefix  = 'wp_';</code></pre>
<p>Since this is localhost we don't have to worry about any of that. When you're finished with that file save it and rename it as <code>wp-config.php</code></p>
<p>Now browse to <code>http://localhost/wordpress/wp-admin/install.php</code> and follow the onscreen instructions. Of course this assumes you haven't renamed the wordpress folder. If you did then you would browse to <code>http://localhost/YourRenamedFolder/wp-admin/install.php</code> You will now be at the WordPress installation screen. See the image below. (click to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/01/install_wp.png"><img class="aligncenter size-medium wp-image-2359" title="Install WordPress" src="http://wpcanada.ca/wp-content/uploads/2011/01/install_wp-274x300.png" alt="Install WordPress" width="274" height="300" /></a></p>
<p>In the screen above fill in the various details and click on Install WordPress. If all goes according to plan you will see a Success message with a log in button.</p>
<p><img class="aligncenter size-full wp-image-2360" title="Success!" src="http://wpcanada.ca/wp-content/uploads/2011/01/wp_installed.png" alt="Success!" width="600" height="299" /></p>
<p><strong>further reading:</strong><br />
<em>http://codex.wordpress.org/Main_Page</em></p>
<p style="text-align: center;">Go to <a title="WPCanada - Install WordPress Locally With XAMPP Pt.1" href="http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-1/">Part 1</a> of this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Install WordPress Locally With XAMPP Pt.1</title>
		<link>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-1/</link>
		<comments>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-1/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 10:46:50 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2335</guid>
		<description><![CDATA[This is Part 1 of a 2 part tutorial. Back in December of 2008 I showed you how to install WampServer and WordPress on your PC in a tut called Installing WordPress Locally. I thought it was time to revisit the topic but this time I'll show you how to do it using XAMPP. Having [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/wordpress_xampp.png" alt="Install WordPress Locally With XAMPP" title="Install WordPress Locally With XAMPP" width="500" height="125" class="aligncenter size-full wp-image-2349" /></p>
<p>This is Part 1 of a 2 part tutorial.</p>
<p>Back in December of 2008 I showed you how to install WampServer and WordPress on your PC in a tut called <a href="http://wpcanada.ca/2008/installing-wordpress-locally/" title="WPCanada: Installing WordPress Locally">Installing WordPress Locally</a>. I thought it was time to revisit the topic but this time I'll show you how to do it using XAMPP.</p>
<p>Having WordPress running in a local environment is a good idea for several reasons,</p>
<ol>
<li>Maintaining a clone of your live blog.</li>
<li>Testing new functionality such as themes or plugins without affecting your live blog.</li>
<li>General experimentation.</li>
</ol>
<p>I currently have over a dozen instances of WordPress on my computer including two SVN flavours.</p>
<p>As I said in the original article WordPress is not an executable. It is a software package written in PHP meaning it needs a few things to operate. The minimum requirements for WordPress 3.0.4 are:</p>
<ul>
<li>PHP version 4.3 or greater</li>
<li>MySQL version 4.1.2 or greater</li>
<li>a server that supports PHP and MySQL preferably Apache</li>
</ul>
<p>XAMPP will install these things for you. Now that we're ready let's begin. Head over to the <a href="http://www.apachefriends.org/en/xampp-windows.html" title="Apache Friends">Apache Friends</a> website and download the <strong>XAMPP for Windows</strong> package. At the time of this writing it is version 1.7.3. For the purposes of this tutorial we will be using the EXE version that weighs in at 51 MB. You'll find it under Basic Package.</p>
<p>After you have downloaded the EXE to your hard drive, double click the XAMPP icon to begin the installation. After double clicking the XAMPP icon you will see the screen below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/001.png" alt="Choose the default directory" title="Choose the default directory" width="552" height="415" class="aligncenter size-full wp-image-2336" /></p>
<p>It's pretty self-explanatory. It's asking you what directory you want to install XAMPP in. Go with the default which is C:\ When ready click on Install. The procedure will take several minutes depending on your system so be patient.</p>
<p>Once the various files have been unpacked and set up you will be presented with a series of dialogue boxes.</p>
<p>The first one you will see is the image below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/002.png" alt="Add shortcuts Yes or No" title="Add shortcuts Yes or No" width="600" height="283" class="aligncenter size-full wp-image-2337" /></p>
<p>In the above screen it is asking if you want to add shortcuts to your desktop and start menu. I chose yes. Make your selection and hit Enter.</p>
<p>Next up is the screen below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/003.png" alt="Locate the XAMPP paths correctly" title="Locate the XAMPP paths correctly" width="600" height="281" class="aligncenter size-full wp-image-2338" /></p>
<p>In the above screen it is asking you if it should locate the XAMPP paths correctly. Choose the default which is Yes. Hit Enter.</p>
<p>After that you will see the following screen,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/004.png" alt="Make a portable XAMPP without drive letters?" title="Make a portable XAMPP without drive letters?" width="600" height="283" class="aligncenter size-full wp-image-2339" /></p>
<p>In the above screen it is asking if it should make a portable XAMPP without drive letters. Pay special attention to the Note on that screen. If you plan on using services you must choose No, which is the default. I chose No because I want the services and don't plan on using USB sticks. When done hit Enter.</p>
<p>Now you will be shown the next screen below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/005.png" alt="Relocating the various paths" title="Relocating the various paths" width="600" height="283" class="aligncenter size-full wp-image-2340" /></p>
<p>When it has finished relocating the various paths hit Enter.</p>
<p>After that you will be presented with the screen below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/006.png" alt="Setting the timezone" title="Setting the timezone" width="600" height="283" class="aligncenter size-full wp-image-2341" /></p>
<p>In the above screen it is telling you that it set the timezone in <code>php.ini</code> and <code>my.ini</code> to America/Chicago and that you should correct it if it is wrong. We'll worry about that later. Hit Enter.</p>
<p>After hitting Enter you will see the following screen,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/007.png" alt="XAMPP is ready" title="XAMPP is ready" width="600" height="282" class="aligncenter size-full wp-image-2342" /></p>
<p>In the above window it is telling you that XAMPP is ready to rock and roll. Select option 1 and hit Enter. This will start the XAMPP Control Panel which sits at the bottom right corner of your screen when maximized. From here you can access the various functions. See the image below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/008.png" alt="XAMPP Control Panel" title="XAMPP Control Panel" width="473" height="396" class="aligncenter size-full wp-image-2343" /></p>
<p>You may see a warning from your firewall - grant permission to both Apache and MySQL. To minimize the Control Panel to the taskbar click the red x in the top right corner.</p>
<p>We now have a functioning server and database installed on our computer.</p>
<p>At this stage you may want to configure a few things such as password protection. Navigate to <code>http://localhost/xampp/</code> and select your language. I chose English. You are now at the XAMPP welcome page.</p>
<p>From the XAMPP welcome page click on Security in the menu on the left side of the page. See the image below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/009.png" alt="Click on Security" title="Click on Security" width="600" height="276" class="aligncenter size-full wp-image-2344" /></p>
<p>After clicking on Security you will see the screen below advising you of security problems. (click image to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2011/01/010.png"><img src="http://wpcanada.ca/wp-content/uploads/2011/01/010-300x90.png" alt="Uh oh!" title="Uh oh!" width="300" height="90" class="aligncenter size-medium wp-image-2345" /></a></p>
<p>Don't worry, this is easy to fix. Navigate to <code>http://localhost/security/xamppsecurity.php</code> Once you navigate there you'll see the screen below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/011.png" alt="Choose your passwords" title="Choose your passwords" width="600" height="480" class="aligncenter size-full wp-image-2346" /></p>
<p>It is in the screen above that you can set your passwords. Referencing the image above, under the heading MYSQL SECTION: ROOT PASSWORD is the password you'll need to access phpMyAdmin. Choose a password and enter it. Don't forget that password because we'll need it again later when we install WordPress. For the options entitled <strong>phpMyAdmin authentication</strong> and <strong>Set a random password for the phpMyAdmin user pma</strong> you can go with the defaults. If you want you can tick the box where it asks if you'd like to store your password in the directory shown. When you're finished click on Password Changing.</p>
<p>Still looking at the image above, let's go down to the section entitled XAMPP DIRECTORY PROTECTION. Select a username and password and enter them. Again, if you want to, tick the box where it asks if you'd like to store your password in the directory shown. When you're finished click on Secure the XAMPP directory.</p>
<p>At this point you will need to restart both Apache and MySQL for the changes to take effect. All you need to do is open the XAMPP Control Panel and click on Stop beside both Apache and MySQL. Wait a few seconds then click Start beside both Apache and MySQL.</p>
<p>Okay, now let's test it. Navigate to <code>http://localhost/xampp/</code> If everything works correctly you should see a dialogue box asking for your login credentials. See the image below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/012.png" alt="XAMPP Login" title="XAMPP Login" width="600" height="182" class="aligncenter size-full wp-image-2347" /></p>
<p>Enter the username and password you chose earlier. Those will be the values you selected under XAMPP DIRECTORY PROTECTION.</p>
<p>If you entered the correct username and password you should now be back at the XAMPP welcome page.</p>
<p>You can access phpMyAdmin in one of two ways:</p>
<ol>
<li>While at the XAMPP welcome page, click on phpMyAdmin in the menu on the left</li>
<li>Navigate directly to <code>http://localhost/phpmyadmin/</code></li>
</ol>
<p>Either method will take you there. When you arrive at the phpMyAdmin screen it will ask you for your login credentials. See the image below,</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/013.png" alt="phpMyAdmin login" title="phpMyAdmin login" width="431" height="291" class="aligncenter size-full wp-image-2348" /></p>
<p>The username you will need is <strong>root</strong> and the password is whatever you chose earlier. It will be the value you entered under the heading MYSQL SECTION: ROOT PASSWORD.</p>
<p>Congratulations! XAMPP is installed and configured along with a fully functioning Apache and MySQL.</p>
<p>In Part 2 of this tutorial we will install WordPress on your computer. Stay tuned for that.</p>
<p><strong>further reading:</strong><br />
<em>http://www.apachefriends.org/en/faq-xampp-windows.html</em><br />
<em>http://www.apachefriends.org/f/viewforum.php?f=16</em></p>
<p style="text-align: center;">Go to <a title="WPCanada - Install WordPress Locally With XAMPP Pt.2" href="http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-2/">Part 2</a> of this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/install-wordpress-locally-with-xampp-pt-1/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Writing Code in Posts Made Easy</title>
		<link>http://wpcanada.ca/2011/writing-code-in-posts-made-easy/</link>
		<comments>http://wpcanada.ca/2011/writing-code-in-posts-made-easy/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 08:37:57 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=2243</guid>
		<description><![CDATA[Do you insert a lot of code in your posts? If you do you know it can be a tedious task at best. Here at WPCanada the majority of our material deals with tutorials and WordPress news. As such, we find ourselves writing a lot of code snippets. The problem with writing code snippets is [...]]]></description>
			<content:encoded><![CDATA[<p>Do you insert a lot of code in your posts? If you do you know it can be a tedious task at best. Here at WPCanada the majority of our material deals with tutorials and WordPress news. As such, we find ourselves writing a lot of code snippets.</p>
<p>The problem with writing code snippets is having your snippet <em>look</em> like code but not <em>behave</em> like code. Let's look at an example of what I mean ...</p>
<pre>&lt;php the_content();&gt;</pre>
<p>The above snippet is a WordPress function that outputs the content of your posts and pages. Now, when including that in a post I can't write it exactly as it appears because WordPress will see the &lt; and &gt; tags and try to execute them. If I want to post a &lt; tag I actually have to write <tt>&amp;lt;</tt> and if I want to include a &gt; tag I have to literally write <tt>&amp;gt;</tt> So you can see how much of a hassle this can become if you post a lot of code.</p>
<p>The other problem is although WordPress includes a <strong>code</strong> button on the Post Editor Toolbar it doesn't include a <strong>pre</strong> button. Of course the code button is for inserting the &lt;code&gt;&lt;/code&gt; tags in your posts. On the occasion you want to insert the &lt;pre&gt;&lt;/pre&gt; tags you have to do so manually.</p>
<p>I'm going to introduce you to two wonderful plugins that will solve both problems.</p>
<h3>Decoder Button</h3>
<p>This plugin is simply a huge time saver. Once activated it adds a Decode button to the Post Editor Toolbar. See image below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/decode_button.png" alt="Decode button" title="Decode button" width="500" height="25" class="aligncenter size-full wp-image-2244" /></p>
<p>What the plugin does it automagically convert &lt; to <tt>&amp;lt;</tt> and &gt; to <tt>&amp;gt;</tt> All you have to do is highlight your selected text with your mouse then hit Decode. The plugin will take care of the rest. You can see what a lifesaver it is if you have a block of code 20 lines long containing numerous &lt; and &gt; tags. Just highlight the entire block and press Decode. The plugin will only convert any &lt; and/or &gt; tags it sees and will not touch anything else.</p>
<p>You can download the plugin from its home at <a href="http://www.scriptygoddess.com/archives/2006/12/23/decoder-button/" title="scriptygoddess: Decoder Button">scriptygoddess</a>.</p>
<h3>Post Editor Buttons</h3>
<p>Post Editor Buttons is another handy plugin to have in your toolbox if you post a lot of code. The plugin allows you to add virtually any button you want to the Post Editor Toolbar. Want to add a <strong>h3</strong> button to your toolbar to make adding subtitles to your posts easier? Done. Want to add a <strong>pre</strong> button to your toolbar to make adding &lt;pre&gt;&lt;/pre&gt; tags to your posts a snap? You got it.</p>
<p>Once activated you can start adding your buttons by navigating to Settings &gt; Post Editor Buttons where you will see the following screen ...</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2011/01/peb.png" alt="Add your buttons" title="Add your buttons" width="500" height="225" class="aligncenter size-full wp-image-2245" /></p>
<p>You can download the plugin from the <a href="http://wordpress.org/extend/plugins/post-editor-buttons/" title="WordPress Plugin Directory: Post Editor Buttons">WordPress Plugin Directory</a>.</p>
<p><strong>Editor's note:</strong> These plugins don't seem to work with the current version of WordPress. Please see the updated version of this post at <a href="http://wpcanada.ca/2011/writing-code-in-posts-made-easy-updated/" title="WPCanada - Writing Code in Posts Made Easy Updated">Writing Code in Posts Made Easy Updated</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2011/writing-code-in-posts-made-easy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

