<?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>This Life of Brian &#187; CMS Tricks</title>
	<atom:link href="http://life-of-brian.com/category/nerds-at-work/cms-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://life-of-brian.com</link>
	<description>My name is Brian.  Welcome to my life.</description>
	<lastBuildDate>Tue, 03 Jan 2012 03:09:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Modify WordPress to Accept New Filetypes as Uploads</title>
		<link>http://life-of-brian.com/2010/09/modify-wordpress-to-accept-new-filetypes-as-uploads/</link>
		<comments>http://life-of-brian.com/2010/09/modify-wordpress-to-accept-new-filetypes-as-uploads/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 00:39:07 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=1632</guid>
		<description><![CDATA[Ran into a new problem with WordPress today. I was working on my photography blog, and I wanted to upload a DNG file (a standardized RAW format) so that people could work along and edit the photo with the Lightroom tutorial. When I tried to upload the photo, I got the unsettling response: &#8220;File type [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into a new problem with WordPress today. I was working on my photography blog, and I wanted to upload a DNG file (a standardized RAW format) so that people could work along and <a href="http://digital-photography-howto.com/three-ways-to-brighten-images-in-lightroom-exposure-fill-light-and-brightness/">edit the photo with the Lightroom tutorial</a>. When I tried to upload the photo, I got the unsettling response: &#8220;File type does not meet security guidelines. Try another.&#8221;</p>
<p>Now I can understand if this was a WordPress.com blog and they had restricted certain filetypes (or another shared host). But this was my blog, gosh darnedit, and I was gonna upload that file if I wanted to&#8230;!</p>
<p>A quick search revealed just the type of WordPress hack that I needed. Read the full explanation of how to modify the <a href="http://chrismeller.com/2007/07/modifying-allowed-upload-types-in-wordpress">allowed upload types in WordPress</a> on Chris Meller&#8217;s blog. The gist of the solution is that WordPress uses a function, &#8220;upload_mimes&#8221; to check what file types are allowed. You can add a filter to hijack that function, add your own filetype, and pass that back to WordPress.</p>
<p>I followed Chris&#8217; directions, added &#8216;dng&#8217; to the array, and it worked like a charm. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2010/09/modify-wordpress-to-accept-new-filetypes-as-uploads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t Create Thumbnails in Nextgen Gallery WordPress Plugin</title>
		<link>http://life-of-brian.com/2010/08/cant-create-thumbnails-in-nextgen-gallery-wordpress-plugin/</link>
		<comments>http://life-of-brian.com/2010/08/cant-create-thumbnails-in-nextgen-gallery-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 14:57:19 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Nextgen Gallery]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=1610</guid>
		<description><![CDATA[Ran into some weird trouble with the Nextgen Gallery WordPress plugin. Couldn&#8217;t find a lot of information to help solve the problem, so I thought I&#8217;d write up the experience for anyone else having a similar problem. In the admin area, you can create custom thumbnails for your images. An image is supposed to pop [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into some weird trouble with the Nextgen Gallery WordPress plugin. Couldn&#8217;t find a lot of information to help solve the problem, so I thought I&#8217;d write up the experience for anyone else having a similar problem.</p>
<p>In the admin area, you can create custom thumbnails for your images. An image is supposed to pop up that you can drag a thumbnail over. But for some reason, when I opened up the window to create a thumbnail, the image didn&#8217;t appear. The image was coming up blank, like if you link to an image that isn&#8217;t there.</p>
<p>The actual image was there on the server, so that wasn&#8217;t a problem. I followed the trail a bit and figured out that the image for the thumbnail creation process was created by a script, nggshow.php (part of the Nextgen plugin). The script itself was working. It fetched all the information, put it in an object, and then it was supposed to spit out an image.</p>
<p>The problem was that the final output is supposed to be a jpeg. But, some white space was added at the top of the file, so the output was corrupted. The jpeg was there, but the browser couldn&#8217;t render it because of the added white space at the top of the file. I don&#8217;t know where exactly that was coming from, but it was added in somewhere in the Nextgen Gallery plugin files.</p>
<p>I tried to go through, eliminate any extra lines outside the php tags, and get rid of the white space. I eliminated one of the two newline characters that was in the output, but I couldn&#8217;t find the second. After pulling my hair for a while, I realized that I was working with an older version of Nextgen Gallery (1.5.3). I updated to the most recent (1.5.5), and it worked fine. Doh.</p>
<p>So&#8230; simple solution. Upgrade to the latest version of the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2010/08/cant-create-thumbnails-in-nextgen-gallery-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make Shortcodes Work in WordPress with the Excerpt</title>
		<link>http://life-of-brian.com/2010/08/how-to-make-shortcodes-work-in-wordpress-with-the-excerpt/</link>
		<comments>http://life-of-brian.com/2010/08/how-to-make-shortcodes-work-in-wordpress-with-the-excerpt/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 23:06:17 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=1605</guid>
		<description><![CDATA[I&#8217;m working on a new theme for another project (Olinda Gibbons Photography), and I ran into a little problem. I wanted to create an excerpt of each post for use in the index page, and I wanted the full post to appear in the single page (single.php). Simple enough. But, a key part of the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a new theme for another project (<a href="http://olinda-gibbons.com">Olinda Gibbons Photography</a>), and I ran into a little problem. I wanted to create an excerpt of each post for use in the index page, and I wanted the full post to appear in the single page (single.php). Simple enough.</p>
<p>But, a key part of the concept was to include a Nextgen Image Gallery in that excerpt. It&#8217;s a photography website, and the point of the blog posts is to show pictures. Seems kind of silly to show a <strong>text</strong> excerpt without the image gallery, eh? I love the Nextgen gallery because it lets me easily upload pictures to the server, organize them into galleries (i.e. job for clients) and then post them on a WordPress page/post with a single piece of shortcode.</p>
<p>The problem is that this shortcode will, by default, execute in the post (when you call the function <code>the_content()</code>), but it won&#8217;t execute in the excerpt (when you call the function <code>the_excerpt()</code>).</p>
<p>I searched around and found a simple solution. Open up (or create) a &#8220;functions.php&#8221; within the root folder of your theme. Insert these two lines of code&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'shortcode_unautop'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'do_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This tells WordPress to execute any shortcodes that it finds when you call <code>the_excerpt()</code>. Just what I was looking for&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2010/08/how-to-make-shortcodes-work-in-wordpress-with-the-excerpt/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to Hide the Navbar on a Blogger Hosted Blog</title>
		<link>http://life-of-brian.com/2009/01/how-to-hide-the-navbar-on-a-blogger-hosted-blog/</link>
		<comments>http://life-of-brian.com/2009/01/how-to-hide-the-navbar-on-a-blogger-hosted-blog/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 21:11:17 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Blogger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=1152</guid>
		<description><![CDATA[So you haven&#8217;t made the jump yet from a Blogger blog to a self-hosted one. Do you really need to have that annoying Blogger navbar display at the top of your page?  Well, according to Blogger&#8217;s ToS, you do. But, if you&#8217;re feeling brave, it&#8217;s incredibly simple to hide it. It&#8217;s not very easy to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-navbar.png"><img class="alignright" title="Blogger Navbar" src="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-navbar-150x150.png" alt="Screenshot pointing out the Blogger Navbar." /></a>So you haven&#8217;t made the jump yet from a Blogger blog to a self-hosted one. Do you really need to have that annoying Blogger navbar display at the top of your page? </p>
<p>Well, according to Blogger&#8217;s ToS, you do. But, if you&#8217;re feeling brave, it&#8217;s incredibly simple to hide it.</p>
<p>It&#8217;s not very easy to physically remove it, but hiding it accomplishes the same goal. Your users will never see it, and it won&#8217;t interfere with any custom layouts you&#8217;ve designed.</p>
<h3>Editing Your Blogger HTML Template<span style="font-weight: normal;"> </span></h3>
<p><a href="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-html-editor.png"><img class="alignright" title="Blogger HTML Editor" src="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-html-editor-300x273.png" alt="Screenshot of the Blogger HTML editor open in a browser window." /></a>In order to hide the navbar, you&#8217;ll need to edit your Blogger site&#8217;s HTML template.</p>
<p>To do so, go to your Blogger dashboard as if you were going to write a post. Then click on the &#8220;Layout&#8221; tab and choose &#8220;Edit HTML.&#8221;</p>
<p>This should bring up a giant box of text that you can edit (see the screenshot to the right).</p>
<p>If you are using the the classic template, you will either have to &#8220;Upgrade Your Template&#8221; (using the instructions that follow) or use slightly different code at the end.</p>
<p>Click on the &#8220;Layout Tab.&#8221; Then, choose &#8220;Customize Design.&#8221; Click the &#8220;Upgrade Your Template&#8221; button and choose the template you want.</p>
<p>Now, click on Layout -&gt; Edit HTML.</p>
<h3>Adding the New Code</h3>
<p><a href="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-updated-html.png"><img class="alignright" title="Updating the Blogger HTML" src="http://life-of-brian.com/wp-content/uploads/2009/01/blogger-updated-html-300x187.png" alt="Add the highlighted line to your template file and click save template." /></a>In order to make the Navbar hidden, you&#8217;ll only need to add one line of code.</p>
<p>The beginning of the text in the textbox (your HTML template) deals with styling information. You want to scroll to <strong>the end</strong> of that. Scroll down until you see the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">]]&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b:skin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Just <strong>before</strong> that line, add the following line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#navbar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Then click the Save Template button, reload your blog, and your navbar should be gone!</p>
<p>If you are using the classic template, you&#8217;ll need to do things only slightly different. In your template, search for this line:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></pre></div></div>

<p>Then, add the following line of code <strong>before</strong> that line:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#navbar-iframe</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Why the difference? Blogger uses a slightly different mechanism for the navbar in the classic template. It&#8217;s launched in an iframe, which is styled by the id #navbar-iframe. In the customized templates, the navbar is within the main page, so you can hide it directly without having to hide the iframe.</p>
<h3>That&#8217;s It?</h3>
<p>Umm&#8230; yeah.</p>
<p>I&#8217;ve seen some examples online where people included a bit more styling information (zero-ing out the margins and padding, for example). I haven&#8217;t found this to be necessary.</p>
<p>I used the code above and tested it (<a href="http://ubersuperblog.blogspot.com/">example here</a>) in Google Chrome, Firefox, and Internet Explorer and they all seemed to work fine.</p>
<p>Like I mentioned before, this is technically against the Blogger T.O.S., so you&#8217;re following this advice at your own risk. I doubt Google would notice, though, and if your site is popular enough to draw Google&#8217;s attention you should probably have moved onto a self-hosted blog anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2009/01/how-to-hide-the-navbar-on-a-blogger-hosted-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Backup Your WordPress Database. Often.</title>
		<link>http://life-of-brian.com/2008/12/backup-your-wordpress-database-often/</link>
		<comments>http://life-of-brian.com/2008/12/backup-your-wordpress-database-often/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 15:09:03 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=786</guid>
		<description><![CDATA[You do backup your Wordpress database... right? If you don't, it's time to start looking into how to do it. The simplest way is to get Wordpress-DB Backup and have a backup e-mailed to yourself daily.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://life-of-brian.com/wp-content/uploads/2008/12/fire.jpg"><img class="alignright" title="Fire" src="http://life-of-brian.com/wp-content/uploads/2008/12/fire-200x300.jpg" alt="Stock image of a large fire burning." /></a>You&#8217;ve spent countless hours over the past year building up your blog. Adding content, getting links, gaining recognition&#8230;</p>
<p>So what happens when you&#8217;re web host&#8217;s database gets fried, and much to your chagrin you don&#8217;t have a backup?</p>
<p>Well, hopefully that will never happen. Hopefully your web host backs up its databases regularly. But that doesn&#8217;t mean you should trust them &#8211; you should do your own backing up.</p>
<p>Now, you could go into phpmyadmin and do this manually. You&#8217;d then have to store the backup on your hard drive, clear out the old ones, and make sure you&#8217;ve got the most recent ones. Manageable, but annoying.</p>
<h3>One of the Most Useful WordPress Plugins&#8230; Ever.</h3>
<p>So get a WordPress plugin to do it for you: <a href="http://www.ilfilosofo.com/blog/wp-db-backup">WordPress Database Backup</a>.</p>
<p>I snagged this when I set up this blog, and I must say: It is awesome.</p>
<p>In the latest version of WordPress, I click on Tools -&gt; Backup in the dashboard to get to the WordPress-DB Backup settings.</p>
<p>From there, you can either manually backup the DB and store it on your computer, or set the plug-in up to automatically backup the database at a regular interval. I&#8217;ve got it set up to backup the database every day and e-mail me the backup file.</p>
<p>Every day around midnight, I get an e-mail containing a thoroughly compressed .sql file with the current backup. All of my current content (~3.6mb unzipped) is about 500kb when it&#8217;s compressed. At that rate, I can leave it in my <a href="http://gmail.com">gmail</a> archives forever and probably never have to worry about running out of space.</p>
<p>With the combination of WordPress DB Backup and Gmail, I can easily store and sort my backups. I never have to worry about cleaning them up to make more space. And the chances of my web host&#8217;s database server <strong>and</strong> Gmail blowing up at the same time are kind of slim. I&#8217;d say that&#8217;s some pretty comforting security.</p>
<p>So what are you waiting for? If you aren&#8217;t backing up your database on a daily basis, grab this plug-in and set a schedule. If you don&#8217;t have a <a href="http://gmail.com">Gmail</a> account, go sign up for one. It&#8217;s free, and I doubt you&#8217;ll ever run out of the 7gb+ storage space it provides.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/12/backup-your-wordpress-database-often/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Grr&#8230; Feedburner.</title>
		<link>http://life-of-brian.com/2008/12/grr-feedburner/</link>
		<comments>http://life-of-brian.com/2008/12/grr-feedburner/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 02:32:17 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Feedburner]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=726</guid>
		<description><![CDATA[Last week, I wrote a quick post about redirecting all my WordPress feeds to Feedburner. I thought everything was working properly&#8230; but it turns out it wasn&#8217;t. The redirects were being done by the .htaccess file and mod_rewrites. If anyone besides the Feedburner bot came to the feed&#8217;s URL, they would get redirected to the [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I wrote a quick post about <a href="http://life-of-brian.com/2008/12/redirecting-wordpress-feeds-to-feedburner/">redirecting all my WordPress feeds to Feedburner</a>. I thought everything was working properly&#8230; but it turns out it wasn&#8217;t.</p>
<p>The redirects were being done by the .htaccess file and mod_rewrites. If anyone besides the Feedburner bot came to the feed&#8217;s URL, they would get redirected to the Feedburner feed.</p>
<p>It seemed to work fine. I double checked each of the feeds by following the links, and I was automatically redirected to the Feedburner feed. What could be wrong?</p>
<p>I just checked one of the category specific feeds, and didn&#8217;t show any of the posts from the past week. Odd.</p>
<p>As it turns out, the Feedburner bot was also being redirected. But the bot was <strong>only</strong> being redirected for the category feeds. For some reason, the mod_rewrite was working fine for the sitewide feed &#8211; allowing the bot through, and redirecting other people to Feedburner &#8211; but it was malfunctioning on the category specific feeds.</p>
<p>To be honest, I have no idea why it didn&#8217;t work, so I just scrapped the idea and worked out something else. I kept the one redirect for the sitewide feed, and I hard-coded the Feedburner URLs into the template for the category specific feeds. Not the most elegant method, but it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/12/grr-feedburner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting WordPress Feeds to Feedburner</title>
		<link>http://life-of-brian.com/2008/12/redirecting-wordpress-feeds-to-feedburner/</link>
		<comments>http://life-of-brian.com/2008/12/redirecting-wordpress-feeds-to-feedburner/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 00:30:10 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Feedburner]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=624</guid>
		<description><![CDATA[Continuing my attempts to improve this site, I decided to embark on creating feedburner feeds for each sub-site. Then, I needed to re-direct my WordPress feed files to feedburner.  Turns out it wasn&#8217;t quite as easy as I hoped. There&#8217;s a WordPress plugin available to redirect your feed to Feedburner, but this only redirects the [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-626" href="http://life-of-brian.com/2008/12/redirecting-wordpress-feeds-to-feedburner/wordpress-and-feedburner/"><img class="alignright" title="Wordpress and Feedburner Logos" src="http://life-of-brian.com/wp-content/uploads/2008/12/wordpress-and-feedburner-300x164.jpg" alt="Image containing the WordPress and Feedburner logos." /></a>Continuing my attempts to improve this site, I decided to embark on creating feedburner feeds for each sub-site. Then, I needed to re-direct my WordPress feed files to feedburner. </p>
<p>Turns out it wasn&#8217;t quite as easy as I hoped. There&#8217;s a <a href="http://www.google.com/support/feedburner/bin/answer.py?answer=78483&amp;topic=13252">WordPress plugin available to redirect your feed</a> to Feedburner, but this only redirects the main feed and the comments feed. No dice for categories.</p>
<p>I found a few people suggesting an alternative: .htaccess rewrites. I never liked working with .htaccess, mostly because I never liked working with regex. But what are ya gonna do?</p>
<h3>An .htaccess Alternative to the Plugin</h3>
<p>I found an example of a <a href="http://perishablepress.com/press/2008/03/25/redirect-wordpress-feeds-to-feedburner-via-htaccess-redux/">.htaccess solution at Persihable Press</a>.</p>
<p>For a full explanation, head over to the original article. But in the meantime, here&#8217;s the .htaccess code he suggested:</p>

<div class="wp_syntax"><div class="code"><pre class="reg" style="font-family:monospace;"># temp redirect all wordpress feeds to feedburner
&nbsp;
 RewriteEngine on
 RewriteCond %<span style="color: #000000;">&#123;</span>REQUEST_URI<span style="color: #000000;">&#125;</span>      ^/?<span style="color: #000000;">&#40;</span>feed.*|comments.*<span style="color: #000000;">&#41;</span>        <span style="color: #000000;">&#91;</span>NC<span style="color: #000000;">&#93;</span>
 RewriteCond %<span style="color: #000000;">&#123;</span>HTTP_USER_AGENT<span style="color: #000000;">&#125;</span> !^.*<span style="color: #000000;">&#40;</span>FeedBurner|FeedValidator<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#91;</span>NC<span style="color: #000000;">&#93;</span>
 RewriteRule ^feed/?.*$          http://feeds.feedburner.com/perishablepress         <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
 RewriteRule ^comments/?.*$      http://feeds.feedburner.com/perishablepresscomments <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span></pre></div></div>

<p>As I understand it, this is more or less a three step process.</p>
<p>First, the regex catches all requests for a URI that includes feed or comments (i.e. your RSS feed). Then, it checks if the user agent is FeedBurner. The FeedBurner bot is allowed to access the original feed, but everybody else should be tossed over to the Feedburner site.</p>
<p>Finally, it sends the user to the appropriate Feedburner URL, based on the request URI.</p>
<h3>Adding Category Feeds</h3>
<p>That, of course, does the same thing as the plugin. It redirects the site feed and the comments feed, but it doesn&#8217;t help you redirect your categories.</p>
<p>For me, each parent category is like it&#8217;s own site, so that doesn&#8217;t help. I&#8217;d like you to be able to subscribe to the &#8220;Nerds at Work&#8221; feed about web development without being bored by all my ranting on education.</p>
<p>Luckily, somebody <a href="http://perishablepress.com/press/2008/03/25/redirect-wordpress-feeds-to-feedburner-via-htaccess-redux/#comment-69064">commented on the original article</a> and left a suggestion as to how to redirect the category feeds. I used that to create my own .htaccess file, and everything seems to work hunky-dory.</p>
<p>You don&#8217;t need to re-write any of the conditions, because that regex will already flag the category feeds. All you need to do is add a few extra rewrite rules, based on the new URIs and provide the appropriate Feedburner URL.</p>
<p>In general, that rewrite rule should look like this&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="reg" style="font-family:monospace;">RewriteRule ^category/nerds-at-work/feed/?.*$
  http://feeds.feedburner.com/thislifeofbrian-work <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span></pre></div></div>

<p>Replace &#8216;nerds-at-work&#8217; with your own category slug, and replace the full URL with the URL to your Feedburner feed.</p>
<p>I had some trouble with this at first, but I think the problem was due to positioning. In the end, I added all of the category specific re-write rules <strong>after</strong> the general rewrite rule. When I placed them first, it didn&#8217;t work. Might just be that I&#8217;m a regex/htaccess newb, though.</p>
<p>Here&#8217;s the full .htaccess file that I&#8217;m using, including what WordPress generated for the pretty-urls.</p>

<div class="wp_syntax"><div class="code"><pre class="reg" style="font-family:monospace;"># Redirect Wordpress Feeds to Feedburner
&nbsp;
RewriteEngine on
RewriteCond %<span style="color: #000000;">&#123;</span>REQUEST_URI<span style="color: #000000;">&#125;</span> ^/?<span style="color: #000000;">&#40;</span>feed.*<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#91;</span>NC<span style="color: #000000;">&#93;</span>
RewriteCond %<span style="color: #000000;">&#123;</span>HTTP_USER_AGENT<span style="color: #000000;">&#125;</span> !^.*<span style="color: #000000;">&#40;</span>FeedBurner|FeedValidator<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#91;</span>NC<span style="color: #000000;">&#93;</span>
RewriteRule ^feed/?.*$ http://feeds.feedburner.com/thislifeofbrian-sitewide <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
RewriteRule ^category/nerds-at-work/feed/?.*$ http://feeds.feedburner.com/thislifeofbrian-work <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
RewriteRule ^category/nerds-at-play/feed/?.*$ http://feeds.feedburner.com/thislifeofbrian-play <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
RewriteRule ^category/teach-them-well/feed/?.*$ http://feeds.feedburner.com/thislifeofbrian-teach <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
RewriteRule ^category/life-of-brian/feed/?.*$ http://feeds.feedburner.com/thislifeofbrian <span style="color: #000000;">&#91;</span>L,NC,R<span style="color: #000000;">=</span>302<span style="color: #000000;">&#93;</span>
&nbsp;
# BEGIN WordPress
&nbsp;
RewriteEngine On
RewriteBase /
RewriteCond %<span style="color: #000000;">&#123;</span>REQUEST_FILENAME<span style="color: #000000;">&#125;</span> !-f
RewriteCond %<span style="color: #000000;">&#123;</span>REQUEST_FILENAME<span style="color: #000000;">&#125;</span> !-d
RewriteRule . /index.php <span style="color: #000000;">&#91;</span>L<span style="color: #000000;">&#93;</span>
&nbsp;
# END WordPress</pre></div></div>

<p>Good luck, and hopefully you&#8217;re more experienced with htaccess/regex than I am.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/12/redirecting-wordpress-feeds-to-feedburner/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>An Argument for Single Spaces After Periods</title>
		<link>http://life-of-brian.com/2008/11/an-argument-for-single-spaces-after-periods/</link>
		<comments>http://life-of-brian.com/2008/11/an-argument-for-single-spaces-after-periods/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 17:45:51 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=436</guid>
		<description><![CDATA[Some time ago, I remember reading an argument over whether you should include one or two spaces after a period. I wish I could find that post that originated it, and comment now. Initially, I agreed with the old print-proponents. Print publishing calls for two spaces after each period. When I type up documents to [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I remember reading an argument over whether you should include one or two spaces after a period. I wish I could find that post that originated it, and comment now.</p>
<p>Initially, I agreed with the old print-proponents. Print publishing calls for two spaces after each period. When I type up documents to be printed, I follow this standard. It&#8217;s a habit, and I don&#8217;t know if I can break it.  I already started typing this post in that way&#8230;</p>
<p>Arguments against the double-space suggest that it&#8217;s pointless. Browsers eliminate a second space and only display one space, so why use two?</p>
<p>Not a very strong argument, in my opinion. But now, I think I&#8217;ve come up with a better one.</p>
<p>I&#8217;m not sure of the cause of the problem &#8211; browser or blogging platform or maybe the theme. However, I&#8217;ve had display issues with posts on this site when I use double spaces after period.</p>
<p>I use Google Chrome as my main browser, and WordPress is the blogging platform. Due to one or the other, the second space is displayed as a non-breaking-space if it is the first character in a line. This causes all kinds of funky, annoying display issues when I use two spaces after each period.</p>
<p>I guess it&#8217;s time to cut out that extra space.</p>
<p>It&#8217;s also time to edit this post and remove them&#8230; because I used double-spaces out of habit. Doh.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/11/an-argument-for-single-spaces-after-periods/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>301 Redirect for Posts in WordPress and CMSMS</title>
		<link>http://life-of-brian.com/2008/11/301-redirect-for-posts-in-wordpress-and-cmsms/</link>
		<comments>http://life-of-brian.com/2008/11/301-redirect-for-posts-in-wordpress-and-cmsms/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 18:40:10 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=298</guid>
		<description><![CDATA[Although this site is new, I&#8217;m slowly incorporating a series of old, defunct projects into it.  I already have a good number of posts/articles written on various topics (Web Design, Education, Gaming), and some of them have some decent search engine visibility. Rather than let these articles languish forever in obscurity, it seems best to [...]]]></description>
			<content:encoded><![CDATA[<p>Although this site is new, I&#8217;m slowly incorporating a series of old, defunct projects into it.  I already have a good number of posts/articles written on various topics (<a href="http://www.earn-web-cash.com">Web Design</a>, <a href="http://www.teachbabel.com">Education</a>, <a href="http://rolling-horde.net">Gaming</a>), and some of them have some decent search engine visibility.</p>
<p>Rather than let these articles languish forever in obscurity, it seems best to add them to the archives of this site.  This has the added benefit of driving some search engine traffic to the site, and helping it get indexed by the search engines much faster.</p>
<p>Using a 301 Redirect, I can automatically direct people to the new location of an article and alert search engines that the article has moved.</p>
<p>You can use some fancy .htaccess editing to redirect a whole site from one domain to another, but this depends on the url structure of the site remaining the same.  I can&#8217;t guarantee that, and in fact I&#8217;m deliberately changing the url structure to better organize the posts into categories and sub-categories.  So I need to be able to re-direct the articles on a page-by-page basis.</p>
<h3>Post-by-Post 301 Redirect in WordPress</h3>
<p>For WordPress, I found a great plug-in to do this &#8211; <a href="http://blog.taragana.com/index.php/archive/wordpress-plugin-for-permanent-redirection-of-posts-angsumans-permanent-redirector-plugin/">Angsuman&#8217;s Permanent Redirect</a>.</p>
<p>Like most WordPress plug-ins, installation is simple.  Download and extract.</p>
<p>Usage is equally simple.  For each post that you want to redirect, create a custom field called &#8220;redirect.&#8221;  Enter the new url of the post as the value of the custom field.</p>
<p>That&#8217;s it.  I&#8217;ve already gone through one site, ported over 100+ posts, and set each one to re-direct to its new address at <a href="http://life-of-brian.com">Life of Brian</a>.  It took me a few hours, but I think it was time well spent.  I&#8217;ve already seen a decent amount of search traffic coming to that section of the site, despite the fact that it&#8217;s only been live for a few days.</p>
<h3>Post-by-Post Redirects in CMS Made Simple</h3>
<p>Although WordPress is now my CMS of choice, I designed an older site with <a href="http://www.cmsmadesimple.org/">CMS Made Simple</a>.  I did a hefty amount of customization to the site, and CMSMS gave me a lot of freedom in writing custom extensions to add to the site&#8217;s functionality.</p>
<p>For now, I want to rescue all of the posts/articles on the site and store them in the new education portion of Life of Brian.  I&#8217;m not sure if there was a plug-in available to do this, but I was easily able to enable post-by-post redirects for any content page.</p>
<p>Here&#8217;s how&#8230;</p>
<h3>Step One: Create a Blank Template</h3>
<p>We&#8217;ll be using a the php <code>header()</code> function to redirect the page, and this should appear before any other output is sent to the user&#8217;s browser.</p>
<p>In my old version of CMSMS, I went to Layout -&gt; Templates in the admin section, and clicked on &#8220;Add New Template.&#8221;  I called it redirect.  I then deleted everything in the main content area, and entered a single line&#8230;</p>
<pre>{content}</pre>
<h3>Step Two: Create a User-Defined Tag</h3>
<p>A user-defined tag is a snippet of php code that you can insert into the content section of any content page in CMSMS.</p>
<p>Go to Extensions -&gt; User Defined Tags in the Admin area.  Then click on &#8220;Add User Defined Tag.&#8221;  I called my tag &#8220;redirect&#8221; and entered the following php snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.1 301 Moved Permanently&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Use the Tag to Redirect a Page</h3>
<p>Now, we can edit any content page on the site and add a custom redirect.</p>
<p>Navigate through the admin area to the page you want to redirect.  Change its template to the &#8220;redirect&#8221; template we created.</p>
<p>Then, add the following snippet as the first line in the content.</p>
<pre>{redirect url="http://new-domain.com/newurl/to-redirect"}</pre>
<p>Just add the URL you want to redirect to inside the quotations, and you&#8217;re good to go.  This calls the user defined tag we created and passes it the URL as a parameter.  The tag then outputs the HTTP redirect header, and the user&#8217;s browser will seamlessly travel to the new site.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/11/301-redirect-for-posts-in-wordpress-and-cmsms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics: Inserting Into a WordPress Template</title>
		<link>http://life-of-brian.com/2008/03/google-analytics-inserting-into-a-wordpress-template/</link>
		<comments>http://life-of-brian.com/2008/03/google-analytics-inserting-into-a-wordpress-template/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 00:08:30 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[CMS Tricks]]></category>
		<category><![CDATA[Nerds at Work]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://life-of-brian.com/?p=329</guid>
		<description><![CDATA[Google Analytics is a great tool for gathering data about your website. You can track and analyze all kinds of data about your visitors, their navigation paths, and the effectiveness of your content. To use Google Analytics, you need to place some javascript on your website. A commonly asked question in forums is, &#8220;How do [...]]]></description>
			<content:encoded><![CDATA[<p>Google Analytics is a great tool for gathering data about your website.  You can track and analyze all kinds of data about your visitors, their navigation paths, and the effectiveness of your content.</p>
<p>To use Google Analytics, you need to place some javascript on your website.  A commonly asked question in forums is, &#8220;How do I add Google Analytics to my WordPress template?&#8221;<br />
<span id="more-329"></span></p>
<h4>Where the Analytics Code Goes</h4>
<p>When you sign up for Google Analytics, Google provides you with a short piece of javascript to place on your site.  The code should look like this.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">&gt;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
var pageTracker = _gat._getTracker(&quot;UA-2894597-3&quot;);
pageTracker._initData();
pageTracker._trackPageview();
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>According to Google&#8217;s instructions, this needs to be placed at the very end of your site &#8211; just before the closing body tag.  To do this, we need to find the closing body tag on the WordPress template.</p>
<h4>Look In Footer.php</h4>
<p>As we previously discovered, a <a href="http://www.earn-web-cash.com/2008/03/10/wordpress-template-basics/">WordPress template</a> is made up of a series of files.  Three basic files &#8211; header.php, sidebar.php, and footer.php &#8211; help build the components of the page.</p>
<p>If your WordPress template follows normal conventions, the closing body tag should be in the footer.php file.</p>
<p>Go to your themes directory of the WordPress installation, navigate to your current theme, and open footer.php.  You should see something like this at the end.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php wp_footer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>Add a blank line before the closing body tag.  Simply copy and paste the javascript code that Google provides on that blank line, save the file, and you&#8217;re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://life-of-brian.com/2008/03/google-analytics-inserting-into-a-wordpress-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

