<?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>WordPress Canada &#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>Mon, 14 Jun 2010 05:22:44 +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>Configuring Trash</title>
		<link>http://wpcanada.ca/2010/01/23/configuring-trash/</link>
		<comments>http://wpcanada.ca/2010/01/23/configuring-trash/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:39:53 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1976</guid>
		<description><![CDATA[Back in November I mentioned a few of the cool new features introduced to WordPress 2.9, one of them being Trash. (see WordPress 2.9 Brings Cool New Features) With Trash enabled, should you accidentally delete any type of content such as post, page, comment etc it is moved to Trash where it can then be [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November I mentioned a few of the cool new features introduced to WordPress 2.9, one of them being Trash. (see <a href="http://wpcanada.ca/2009/11/12/wordpress-2-9-brings-cool-new-features/" title="WordPress Canada - WordPress 2.9 Brings Cool New Features">WordPress 2.9 Brings Cool New Features</a>) With Trash enabled, should you accidentally delete any type of content such as post, page, comment etc it is moved to Trash where it can then be either restored or permanently deleted ala the Windows Recycle Bin. The default setting for content to remain in Trash before it gets deleted is 30 days. Did you know you can change that via the <code>wp-config.php</code> file?</p>
<p>Let's say that you want to change the default setting from 30 days to 7 days. Add the following to the <code>wp-config.php</code> file ...</p>
<p><code>define('EMPTY_TRASH_DAYS', 7 );</code></p>
<p>You can adjust the number to anything you want. If you want to disable Trash change the number to 0 as such ...</p>
<p><code>define('EMPTY_TRASH_DAYS', 0 );</code></p>
<p>To see a cool list of configuration settings that can be set/changed via <code>wp-config</code> check out the <a href="http://codex.wordpress.org/Editing_wp-config.php" title="WordPress Codex - Editing wp-config.php">documentation</a> at the Codex.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2010/01/23/configuring-trash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Delay Your Feed Publishing</title>
		<link>http://wpcanada.ca/2010/01/07/delay-your-feed-publishing/</link>
		<comments>http://wpcanada.ca/2010/01/07/delay-your-feed-publishing/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 12:14:42 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1969</guid>
		<description><![CDATA[Have you ever written a post then hit the publish button only to discover you missed a typo? I've done it a few times even after proofreading my copy. Of course you can always edit the post but the problem is your RSS feed has already been published and sent out. You can't edit that [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever written a post then hit the publish button only to discover you missed a typo? I've done it a few times even after proofreading my copy. Of course you can always edit the post but the problem is your RSS feed has already been published and sent out. You can't edit that and it will take some time for the caches of the various feed services to clear and reflect your edit. I'll show you how to avoid this problem by adding a simple delay so that your blog does not immediately publish your feed.</p>
<p>In a plain text editor such as Notepad, open your theme's <code>functions.php</code> and add the following ...</p>
<pre>//delay feed publishing
function publish_later_on_feed($where) {
global $wpdb;

if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate('Y-m-d H:i:s');

// value for wait; + device
$wait = 'x'; // integer

// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

// add SQL-sytax to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb-&gt;posts.post_date_gmt, '$now') &gt; $wait ";
}
return $where;
}

add_filter('posts_where', 'publish_later_on_feed');</pre>
<p>What we have done is add a filter to the <code>publish_later_on_feed</code> function so that your feed is not published at the same time your post is. You can adjust the time delay to anything you want. Look for the line, </p>
<p><code>$wait = 'x'; // integer</code> and change x accordingly. For instance, if you wanted a 30 minute delay that line would look like,</p>
<p><code>$wait = '30'; // integer</code></p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2010/01/07/delay-your-feed-publishing/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How To Disable Your RSS Feed</title>
		<link>http://wpcanada.ca/2009/12/22/how-to-disable-your-rss-feed/</link>
		<comments>http://wpcanada.ca/2009/12/22/how-to-disable-your-rss-feed/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 16:15:30 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1940</guid>
		<description><![CDATA[A question I've seen from time to time is how do I disable my RSS feed? The answer is surprisingly easy. But before I get to that you may be wondering why someone would want to do that. There could be any number of reasons such as you're using WordPress as a CMS with basically [...]]]></description>
			<content:encoded><![CDATA[<p>A question I've seen from time to time is <em>how do I disable my RSS feed</em>? The answer is surprisingly easy. But before I get to that you may be wondering why someone would want to do that. There could be any number of reasons such as you're using WordPress as a CMS with basically static content rather than a blog with dynamic content. In this case a feed wouldn't really serve a purpose. Perhaps you're fed up with scrapers and see this as a last resort. The reason is irrelevant.</p>
<p>All we need to do is add a bit of code to the active theme's <code>functions.php</code> file. Before we begin be sure to backup that file. If you make a mistake you may bork your entire site. Open the active theme's <code>functions.php</code> file in a plain text editor and add the following...</p>
<p><code>
<pre>//disable feed
function fb_disable_feed() {
	wp_die( __('&lt;strong&gt;Error:&lt;/strong&gt; No RSS feed available, please visit our &lt;a href="'. get_bloginfo('url') .'"&gt;homepage&lt;/a&gt; for the latest articles!') );
}

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>Now when you click one of your RSS links you will see the following message, (click image to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/no_feed.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/no_feed-300x47.png" alt="" title="no_feed" width="300" height="47" class="aligncenter size-medium wp-image-1941" /></a></p>
<p>If you want to reactivate the feed simply delete the code you added to the <code>functions.php</code> file. It goes without saying this is theme-specific. That is, if you change themes you'll have to add the code to that theme's <code>functions.php</code> file as well. Or, you could make a plugin out of this and drop it in your plugin folder. That way it will work regardless of the theme you are using. It's much easier to turn off as well.</p>
<p><del>Upon re-reading my post it occurred to me some of you may not know how to turn this in to a plugin. Fear not for I have done it for you. You can get Feed Killer from the Downloads page. [currently unavailable] Simply download the ZIP to your computer, extract the file <code>feed_killer.php</code> and upload it to your plugin folder. Activate as you would any other plugin. To turn your feed back on deactivate the plugin.</del> I should have searched the WordPress plugin repo prior to doing this as such a plugin <a href="http://wordpress.org/extend/plugins/disable-rss/" title="WordPress Plugin Directory - Disable RSS">already exists</a>. You can download it there.</p>
<p><strong>Edit:</strong> New information has come to my attention as to the original author of the snippet above. Thanks to Alex at <a href="http://wpengineer.com/" title="WordPress News, Hacks, Tipps, Tutorials, Plugins and Themes - WP Engineer">WP Engineer.com</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/12/22/how-to-disable-your-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control Your Dashboard Widgets</title>
		<link>http://wpcanada.ca/2009/12/14/control-your-dashboard-widgets/</link>
		<comments>http://wpcanada.ca/2009/12/14/control-your-dashboard-widgets/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 06:19:19 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1924</guid>
		<description><![CDATA[When you log in to your WordPress blog you are automatically redirected to the Dashboard area - an area displaying various widgets, each containing useful information such as Right Now, Recent Comments and Incoming Links to name a few. What if you wanted to disable some or all of them? One option is to click [...]]]></description>
			<content:encoded><![CDATA[<p>When you log in to your WordPress blog you are automatically redirected to the Dashboard area - an area displaying various widgets, each containing useful information such as Right Now, Recent Comments and Incoming Links to name a few. What if you wanted to disable some or all of them? </p>
<p>One option is to click the Screen Options button at the top of the page which reveals all available dashboard widgets, each with a nifty check box beside its name. Simply unchecking the appropriate box will hide the widget from your Dashboard. To re-enable it tick the box. See screen shot below. (click image to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/dashboard_widgets.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/dashboard_widgets-300x95.png" alt="dashboard_widgets" title="dashboard_widgets" width="300" height="95" class="aligncenter size-medium wp-image-1925" /></a></p>
<p>But what if, for some reason, you want to completely disable one or more widgets as opposed to hiding them? Sure you can do so by hacking core files but this is not recommended. A better option is to add a bit of code to your theme's <code>functions.php</code> file.</p>
<p>First, let's take a look at what the Codex has to say about <a href="http://codex.wordpress.org/Dashboard_Widgets_API" title="Codex">Dashboard Widgets</a>. Here are the names of the meta boxes on the dashboard:</p>
<p>Main column<br />
<code>$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']<br />
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']<br />
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']<br />
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']</code></p>
<p>Side Column<br />
<code>$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']<br />
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']<br />
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']<br />
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']</code></p>
<p>To remove select items we will manually <code>unset()</code> their items from the general <code>$wp_meta_box</code> array via the theme's <code>functions.php</code> file.</p>
<p>Using the example provided by the Codex, to remove the quickpress and incoming_links widgets, add the following to your theme's <code>functions.php</code> file,</p>
<p><code>
<pre>// Create the function to use in the action hook

function example_remove_dashboard_widgets() {
	// Globalize the metaboxes array, this holds all the widgets for wp-admin

	global $wp_meta_boxes;

	// Remove the quickpress widget

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);

	// Remove the incomming links widget

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
} 

// Hoook into the 'wp_dashboard_setup' action to register our function

add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );</pre>
<p></code></p>
<p>Look at the above carefully. Recall that the meta box for the quick_press widget is...</p>
<p><code>$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']</code></p>
<p>See how we manually remove it via <code>unset()</code> as such...</p>
<p><code>unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);</code></p>
<p>You can follow this example to disable each of the widgets. In a local install I disabled all dashboard widgets. See the screen shot below. (click image to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/widgets_disabled.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/widgets_disabled-300x84.png" alt="widgets_disabled" title="widgets_disabled" width="300" height="84" class="aligncenter size-medium wp-image-1926" /></a></p>
<p>I accomplished this by making use of the info earlier in this post then by adding the following to my theme's <code>functions.php</code> file...</p>
<p><code>
<pre>// Create the function to use in the action hook

function example_remove_dashboard_widgets() {
	// Globalize the metaboxes array, this holds all the widgets for wp-admin

	global $wp_meta_boxes;

	// Remove the quickpress widget

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);

	// Remove the recent drafts widget

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);

	// Remove the wordpress dev blog widget

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);

	// Remove the other wp news widget

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);

	// Remove the incomming links widget

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);

	// Remove the dashboard right now widget

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);

	// Remove the recent comments widget

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);

	// Remove the plugins widget

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
} 

// Hoook into the 'wp_dashboard_setup' action to register our function

add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );</pre>
<p></code></p>
<p>To re-enable any of the widgets simply remove the appropriate code from the <code>functions.php</code> file. To re-enable all of them remove all of the code.</p>
<p><em>Further reading: http://codex.wordpress.org/Dashboard_Widgets_API </em></p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/12/14/control-your-dashboard-widgets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To Change Your Site URL</title>
		<link>http://wpcanada.ca/2009/12/06/how-to-change-your-site-url/</link>
		<comments>http://wpcanada.ca/2009/12/06/how-to-change-your-site-url/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 05:54:41 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1916</guid>
		<description><![CDATA[A problem I see come up in the WordPress forums quite often is a blogger who is locked out of his own blog. This is usually a result of playing with the values found at Settings &#62; General. See screenshot below. (click to enlarge) Although there are legitimate cases of wanting to change the Blog [...]]]></description>
			<content:encoded><![CDATA[<p>A problem I see come up in the WordPress forums quite often is a blogger who is locked out of his own blog. This is usually a result of playing with the values found at Settings &gt; General. See screenshot below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/g-settings.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/g-settings-300x92.png" alt="g-settings" title="g-settings" width="300" height="92" class="aligncenter size-medium wp-image-1917" /></a></p>
<p>Although there are legitimate cases of wanting to change the Blog address (URL), such as when you are planning to give <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory" title="Codex">WordPress its own directory</a>, for the vast majority of users however the values depicted in the image above should be left alone. It's when people start changing them that chaos ensues. Fortunately the fix is an easy one. In this post I'll give you three different methods for changing the values back to what they should be should you find yourself locked out of your blog.</p>
<p><strong>Method #1: Edit wp-config.php</strong><br />
This is probably the easiest method of the three. Open the <code>wp-config.php</code> file in a plain text editor such as Notepad and add the following lines ...</p>
<p><code>
<pre>define('WP_HOME','http://yoursite.com');
define('WP_SITEURL','http://yoursite.com');</pre>
<p></code></p>
<p>... where yoursite.com is the correct URL. It goes without saying you will need to log in to your site via FTP.</p>
<p><strong>Method #2: Edit the active theme's functions.php file</strong><br />
This method is a bit more involved than the previous one but is still fairly straightforward. We will need to edit the <code>functions.php</code> file of the <strong>currently active theme</strong>. If it doesn't exist then we'll need to create it. It's important to note it must belong to the currently active theme.</p>
<p>Okay, open <code>functions.php</code> in a plain text editor and immediately after the line containing the opening <code>&lt;?php</code> tag add the following ...</p>
<p><code>
<pre>update_option('siteurl','http://yoursite.com');
update_option('home','http://yoursite.com');</pre>
<p></code></p>
<p>... where once again yoursite.com is the correct URL.</p>
<p>If the active theme doesn't have its own <code>functions.php</code> file don't worry it's easy to create. In a plain text editor create a file called <code>functions.php</code> and add the following to it ...</p>
<p><code>
<pre>&lt;?php
update_option('siteurl','http://yoursite.com');
update_option('home','http://yoursite.com');</pre>
<p></code></p>
<p>Upload the file to the active theme directory.</p>
<p><strong>Method #3: Edit the database</strong><br />
Although this method can seem very daunting, even downright terrifying to newbies, it's not that difficult. One thing to remember - you will be directly interacting with your database. There is no undo. If you make a mistake the consequences could be disastrous. Prior to manipulating your database, and I can't stress this enough, create a backup. You will find easy <a href="http://codex.wordpress.org/WordPress_Backups" title="Codex">step by step instructions</a> at the Codex. Scroll down to the section called Backup Documentation.</p>
<p>Now that I've scared the jeebus out of you let's proceed. For this example we will be using phpMyAdmin - a program for manipulating the MySQL database.</p>
<p>Log in to your host's phpMyAdmin and select the appropriate database. See screenshot below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/choose_database.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/choose_database-217x300.png" alt="choose_database" title="choose_database" width="217" height="300" class="aligncenter size-medium wp-image-1918" /></a></p>
<p>Obviously your environment will most likely look different. I have a bunch of local WordPress installs hence the reason for all of those databases.</p>
<p>Once you have selected your database you will come to a screen like the one below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/tables.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/tables-300x132.png" alt="tables" title="tables" width="300" height="132" class="aligncenter size-medium wp-image-1919" /></a></p>
<p>Keeping the image above in mind you need to click the Browse button of the <code>wp_options</code> table. Now, your table prefix may or may not be <code>wp_</code> depending on if you manually changed them to something else. For the purposes of this article we'll assume not.</p>
<p>After clicking the browse button of the <code>wp_options</code> table you will see the screen below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/siteurl.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/siteurl-300x124.png" alt="siteurl" title="siteurl" width="300" height="124" class="aligncenter size-medium wp-image-1921" /></a></p>
<p>Upon clicking the pencil icon you will see the screen below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/12/edit_siteurl.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/12/edit_siteurl-300x144.png" alt="edit_siteurl" title="edit_siteurl" width="300" height="144" class="aligncenter size-medium wp-image-1922" /></a></p>
<p>Once you changed the siteurl value back to what it should be all you need to do is go back to the <code>wp_options</code> table, look for home and do the same thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/12/06/how-to-change-your-site-url/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Change WordPress Table Prefix</title>
		<link>http://wpcanada.ca/2009/11/21/how-to-change-wordpress-table-prefix/</link>
		<comments>http://wpcanada.ca/2009/11/21/how-to-change-wordpress-table-prefix/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 05:42:47 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1902</guid>
		<description><![CDATA[Changing the prefix of your WordPress tables will add an extra layer of security to your site and is not at all difficult to do. Whenever I install WordPress I do so manually via FTP but many users prefer to use an automated script like Fantastico. While convenient, the problem with Fantastico is that it [...]]]></description>
			<content:encoded><![CDATA[<p>Changing the prefix of your WordPress tables will add an extra layer of security to your site and is not at all difficult to do. Whenever I install WordPress I do so manually via FTP but many users prefer to use an automated script like Fantastico. While convenient, the problem with Fantastico is that it uses the <code>wp_</code> prefix as a default value - something all of the bad guys know and can attempt to exploit by targeting the <code>wp_options</code> table. While there are a number of plugins that will do the trick I'll show you how to do it manually.</p>
<p><strong>Backup Your Database</strong><br />
This should be your first step. Whenever interacting directly with your database via a tool like phpMyAdmin always backup your database. It can save you much grief later.</p>
<p><strong>Edit the wp-config file</strong><br />
Open the wp-config.php file in a plain text editor and at or about Line 57 you will see...</p>
<p><code>$table_prefix  = 'wp_';</code></p>
<p>change that to something a bit more obscure like...</p>
<p><code>$table_prefix  = '6EW6xEjuC_';</code></p>
<p>It's important to note you can only use letters, numbers and underscores. Once complete put the file away as we are finished with it.</p>
<p><strong>Rename Your Tables</strong><br />
This is the fun part. Don't worry, it's an easy procedure. Fire up phpMyAdmin and select your database. Click on the SQL Query icon to launch a new window. See image below.</p>
<p><img src="http://wpcanada.ca/wp-content/uploads/2009/11/query.png" alt="query" title="query" width="200" height="316" class="aligncenter size-full wp-image-1903" /></p>
<p>A default installation of WordPress will have 10 tables. Your install may have more depending on what plugins you use but any additional tables will also have to be renamed.</p>
<p>When you click the SQL Query icon a new window will open. In that window enter the command to rename your tables one at a time. This is the data you need to change...</p>
<p><code>Rename table wp_comments to 6EW6xEjuC_comments;<br />
Rename table wp_links to 6EW6xEjuC_links;<br />
Rename table wp_options to 6EW6xEjuC_options;<br />
Rename table wp_postmeta to 6EW6xEjuC_postmeta;<br />
Rename table wp_posts to 6EW6xEjuC_posts;<br />
Rename table wp_terms to 6EW6xEjuC_terms;<br />
Rename table wp_term_relationships to 6EW6xEjuC_term_relationships;<br />
Rename table wp_term_taxonomy to 6EW6xEjuC_term_taxonomy;<br />
Rename table wp_usermeta to 6EW6xEjuC_usermeta;<br />
Rename table wp_users to 6EW6xEjuC_users;</code></p>
<p>For instance, click the SQL Query icon to launch a new window. In that window enter...</p>
<p><code>Rename table wp_comments to 6EW6xEjuC_comments;</code></p>
<p>then click Go. You will see the newly renamed table. See image below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/enter_query.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/enter_query-300x113.png" alt="enter_query" title="enter_query" width="300" height="113" class="aligncenter size-medium wp-image-1904" /></a></p>
<p>Do this one at a time until all tables have been renamed.</p>
<p><strong>Edit wp_options</strong><br />
You now need to edit some data in the wp_options table which should actually now be called 6EW6xEjuC_options. Select the 6EW6xEjuC_options table and click the Browse icon. See image below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/browse_icon.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/browse_icon-300x110.png" alt="browse_icon" title="browse_icon" width="300" height="110" class="aligncenter size-medium wp-image-1905" /></a></p>
<p>After clicking the Browse icon you will see a new screen. Under the option_name heading at the top, search for wp_user_roles and change it to 6EW6xEjuC_user_roles. See image below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/user_roles.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/user_roles-300x65.png" alt="user_roles" title="user_roles" width="300" height="65" class="aligncenter size-medium wp-image-1906" /></a></p>
<p>Referencing the image above, click the Pencil icon in the wp_user_roles row. You will see a new screen. See image below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/change_user_roles.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/change_user_roles-300x138.png" alt="change_user_roles" title="change_user_roles" width="300" height="138" class="aligncenter size-medium wp-image-1907" /></a></p>
<p><strong>Edit wp_usermeta</strong><br />
This is the final step. Change the data contained within the wp_usermeta table which should now be called 6ew6xejuc_usermeta. Click the Browse icon next to the 6ew6xejuc_usermeta table. See image below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/user_meta.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/user_meta-300x200.png" alt="user_meta" title="user_meta" width="300" height="200" class="aligncenter size-medium wp-image-1908" /></a></p>
<p>After clicking the Browse icon you will see a screen similar to the one below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/change_usermeta.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/change_usermeta-300x104.png" alt="change_usermeta" title="change_usermeta" width="300" height="104" class="aligncenter size-medium wp-image-1909" /></a></p>
<p>Referencing the above image, search under the meta_key heading and change all values starting with the old wp_ prefix. For instance, in the above image you want to change wp_capabilities to 6EW6xEjuC_capabilities and wp_user_level to 6EW6xEjuC_user_level. You do so by clicking the Pencil icon in the appropriate row. It's important to note your install may have more data than is shown above. If so, you need to change that as well. The example I'm using is a default, no-frills install.</p>
<p>Clicking the Pencil icon in the wp_capabilities row will bring up the screen below. (click to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/change_wp_capabilities.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/change_wp_capabilities-300x129.png" alt="change_wp_capabilities" title="change_wp_capabilities" width="300" height="129" class="aligncenter size-medium wp-image-1910" /></a></p>
<p>Do this for each applicable row until done. That's it.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/11/21/how-to-change-wordpress-table-prefix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Insert Special Characters Into Horizontal Menu</title>
		<link>http://wpcanada.ca/2009/11/18/insert-special-characters-into-horizontal-menu/</link>
		<comments>http://wpcanada.ca/2009/11/18/insert-special-characters-into-horizontal-menu/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 05:53:33 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1900</guid>
		<description><![CDATA[Hardcoding a navigation menu to display a list of pages is not necessary thanks to the wp_list_pages() template tag which automatically generates the list for you. Perusing the Codex we see this template tag accepts numerous parameters to modify the output. A standard use of this tag in a horizontal navigation menu might look like [...]]]></description>
			<content:encoded><![CDATA[<p>Hardcoding a navigation menu to display a list of pages is not necessary thanks to the <code>wp_list_pages()</code> template tag which automatically generates the list for you. Perusing the <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages" title="Codex">Codex</a> we see this template tag accepts numerous parameters to modify the output. A standard use of this tag in a horizontal navigation menu might look like this...</p>
<p><code>&lt;?php wp_list_pages('title_li='); ?&gt;</code></p>
<p>The parameter <code>title_li</code> sets the text and style of the list's heading. The default reverts to 'Pages' but if left blank as above nothing is displayed. Thus using <code>wp_list_pages</code> with the parameter <code>title_li=</code> will render a list of pages with no heading.</p>
<p>What if we wanted to insert a special character such as ' | ' or ' // ' between the individual menu items? Do we then have to manually code our navigation menu? Not at all. All we need to do is make a slight modification. Take a look at the code below...</p>
<p><code>&lt;?php<br />
$char = ' // ';<br />
wp_list_pages('link_before=&lt;li&gt;&#038;link_after='.$char.'&lt;/li&gt;');<br />
?&gt;</code></p>
<p>What this will do is generate a list of pages with // between each menu item. Cool, yes? How do we use this with the <code>title_li</code> parameter? Let's throw a couple of things into the mix so you better understand the string. Let's use the parameters <code>title_li</code> and <code>exclude</code> with the above code. It would now look like...</p>
<p><code>&lt;?php<br />
$char = ' // ';<br />
wp_list_pages('title_li=&#038;exclude=1050,1255&#038;link_before=&lt;li&gt;&#038;link_after='.$char.'&lt;/li&gt;');<br />
?&gt;</code></p>
<p>What this will do is generate a list of pages, with no heading and omitting the pages with the numerical ID of 1050 and 1255 while inserting // between each menu item. You can use as many parameters as you want - just be sure to preface each one with &#038;. Let's see a screen shot of what it looks like. (click image to enlarge)</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/img001.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/img001-300x59.png" alt="img001" title="img001" width="300" height="59" class="aligncenter size-medium wp-image-1901" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/11/18/insert-special-characters-into-horizontal-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Popup Images Without a Plugin</title>
		<link>http://wpcanada.ca/2009/11/15/create-popup-images-without-a-plugin/</link>
		<comments>http://wpcanada.ca/2009/11/15/create-popup-images-without-a-plugin/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 04:25:05 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1897</guid>
		<description><![CDATA[Creating a popup effect for an image contained within a post is a cool way to add a little style to your blog. It also negates having your readers view the enlarged image on another page then hitting the back button to return to your post. There are different ways to accomplish this including the [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a popup effect for an image contained within a post is a cool way to add a little style to your blog. It also negates having your readers view the enlarged image on another page then hitting the back button to return to your post. There are different ways to accomplish this including the use of various plugins. But did you know you don't need a plugin? Let's see it in action. Click the image below to enlarge.</p>
<p><a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/glasses.jpg"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/glasses-300x200.jpg" alt="glasses" title="glasses" width="300" height="200" class="aligncenter size-medium wp-image-1899" /></a></p>
<p>How did I do this? WordPress already comes bundled with <a href="http://jquery.com/demo/thickbox/" title="a webpage UI dialog widget written in JavaScript on top of the jQuery library">Thickbox</a>. It is how theme previews etc are displayed. All we need to do is call Thickbox then add the class "thickbox" to the href tag linking the larger image.</p>
<p>First, add the following to your theme's <code>functions.php</code> file,</p>
<p><code>
<pre>function theme_queue_js(){
  if (!is_admin()){
    wp_enqueue_script('jquery');
    add_thickbox();
    wp_enqueue_style('thickbox');
}
}

add_action( 'get_header', 'theme_queue_js' );</pre>
<p></code></p>
<p>Now all you need to do is add <code>class="thickbox"</code> to the href tag linking your larger image. For example, the code for displaying the above image is...</p>
<p><code>&lt;a href="http://wpcanada.ca/wp-content/uploads/2009/11/glasses.jpg"&gt;&lt;img src="http://wpcanada.ca/wp-content/uploads/2009/11/glasses-300x200.jpg" alt="glasses" title="glasses" width="300" height="200" class="aligncenter size-medium wp-image-1899" /&gt;&lt;/a&gt;</code></p>
<p>The image displayed is a medium sized image (300x200 px) and is called by the img tag. It is linked to the full sized image as stipulated in the href tag. We add class="thickbox" to the href tag as such...</p>
<p><code>&lt;a class="thickbox" href="http://wpcanada.ca/wp-content/uploads/2009/11/glasses.jpg"&gt;&lt;img src="http://wpcanada.ca/wp-content/uploads/2009/11/glasses-300x200.jpg" alt="glasses" title="glasses" width="300" height="200" class="aligncenter size-medium wp-image-1899" /&gt;&lt;/a&gt;</code></p>
<p>If you're looking for something a little fancier you might want to use a plugin but for basic functionality this works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/11/15/create-popup-images-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Change Default Text on Protected Posts</title>
		<link>http://wpcanada.ca/2009/11/15/change-default-text-on-protected-posts/</link>
		<comments>http://wpcanada.ca/2009/11/15/change-default-text-on-protected-posts/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 23:37:05 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1895</guid>
		<description><![CDATA[By default, WordPress will display the following text for password protected posts, This post is password protected. To view it please enter your password below: This is determined by Line 1146 at wp-includes/post-template.php. What if you wanted to change that output to something else? One solution would be to simply edit Line 1146 at wp-includes/post-template.php. [...]]]></description>
			<content:encoded><![CDATA[<p>By default, WordPress will display the following text for password protected posts,</p>
<blockquote><p>This post is password protected. To view it please enter your password below:</p></blockquote>
<p>This is determined by Line 1146 at <code>wp-includes/post-template.php.</code> What if you wanted to change that output to something else? One solution would be to simply edit Line 1146 at <code>wp-includes/post-template.php.</code> Of course editing core files is never a good idea unless you know what you are doing. A much better solution is to create a new function and add a filter.</p>
<p>Add the following to your theme's <code>functions.php</code> file,</p>
<p><code>
<pre>add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
	global $post;
	$label = 'pwbox-'.( empty( $post-&gt;ID ) ? rand() : $post-&gt;ID );
	$o = '&lt;form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post"&gt;
	' . __( "This post is password protected. To view it please enter your password below:" ) . '
	&lt;label for="' . $label . '"&gt;' . __( "Password:" ) . ' &lt;/label&gt;&lt;input name="post_password" id="' . $label . '" type="password" size="20" /&gt;&lt;input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /&gt;
	&lt;/form&gt;
	';
	return $o;
}</pre>
<p></code></p>
<p>Edit the appropriate text above.</p>
<p>Note that the new function has been assigned a class &gt; protected-post-form. To make use of this simply add <code>.protected-post-form</code> to your theme's style sheet along with whatever styling rules you want. For instance, using the default Kubrick theme I added the following to the style sheet,</p>
<p><code>
<pre>.protected-post-form {
      background:#FF0000;
      color:#fff;
      border:1px solid #000;
}</pre>
<p></code></p>
<p>This is the result, (click image to enlarge)</p>
<p><a href="http://wpcanada.ca/wp-content/uploads/2009/11/protected.png"><img src="http://wpcanada.ca/wp-content/uploads/2009/11/protected-300x216.png" alt="protected" title="protected" width="300" height="216" class="aligncenter size-medium wp-image-1896" /></a></p>
<p>via the <a href="http://wordpress.org/support/topic/323715" title="official WordPress Support Forum">WordPress Support Forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/11/15/change-default-text-on-protected-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Display List of Scheduled Posts</title>
		<link>http://wpcanada.ca/2009/04/14/display-list-of-scheduled-posts/</link>
		<comments>http://wpcanada.ca/2009/04/14/display-list-of-scheduled-posts/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 23:57:45 +0000</pubDate>
		<dc:creator>Len Kutchma</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wpcanada.ca/?p=1547</guid>
		<description><![CDATA[Of the many cool features incorporated into WordPress one of the coolest has to be the ability to schedule posts for future publishing. This could come in handy if for example you are planning to be away for an extended period of time. You could write several entries beforehand then schedule them to be published [...]]]></description>
			<content:encoded><![CDATA[<p>Of the many cool features incorporated into WordPress one of the coolest has to be the ability to schedule posts for future publishing. This could come in handy if for example you are planning to be away for an extended period of time. You could write several entries beforehand then schedule them to be published at regular intervals in your absence. A great way to further enhance this is to display a list of your scheduled posts somewhere in your theme, the most logical being the sidebar.</p>
<p>Why do this? If you have a regular following it's a way to create a little suspense for your readers. Add the following to <code>sidebar.php</code> ...</p>
<p><code>
<pre>&lt;?php
$my_query = new WP_Query('post_status=future&#038;order=DESC&#038;showposts=5');
if ($my_query-&gt;have_posts()) {
while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
   &lt;?php the_title(); ?&gt;
&lt;?php endwhile;
}
?&gt;</pre>
<p></code></p>
<p>This will pull the latest 5 scheduled posts from the database and display their titles. You could use a heading like "Coming Soon.."</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanada.ca/2009/04/14/display-list-of-scheduled-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
