<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>WordPress Guy</title>
	
	<link>http://wpguy.com</link>
	<description>WordPress tips, tutorials, plugins and themes</description>
	<pubDate>Tue, 11 Nov 2008 12:41:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/wpguy" type="application/rss+xml" /><feedburner:emailServiceId>1962928</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>I’m back, redesigned</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/449520402/</link>
		<comments>http://wpguy.com/articles/im-back-redesigned/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 12:39:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://wpguy.com/etc/im-back-redesigned/</guid>
		<description><![CDATA[You may have noticed that I haven&#8217;t updated the blog for some months now. This is just a quick post to let you know that I&#8217;m back.
To celebrate, I have completely redesigned the site and tweaked the guy in the header to look more like me. It&#8217;s not quite finished yet, but I couldn&#8217;t wait [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that I haven&#8217;t updated the blog for some months now. This is just a quick post to let you know that I&#8217;m back.</p>
<p>To celebrate, I have completely redesigned the site and tweaked the guy in the header to look more like me. It&#8217;s not quite finished yet, but I couldn&#8217;t wait any longer.</p>
<p><span id="more-73"></span></p>
<h3>What happened</h3>
<p>I&#8217;m not going to lie to you, the main reason I stopped creating tutorials, themes and plugins is because I wasn&#8217;t very motivated and didn&#8217;t have much time either.</p>
<h3>The future</h3>
<p>What should you expect from WordPress Guy?</p>
<p>From now on, I&#8217;m not going to post as often as I used to (which was 3-4 posts per week). I&#8217;m going to focus on producing higher quality content, even if it&#8217;s just once a week, or maybe less.</p>
<h3>Goodies?</h3>
<p>At the moment, I have a WordPress plugin that is almost finished and will post shortly.</p>
<p>I may also release my previous WordPress Guy theme.</p>
<p>I also have some ideas for great tutorials and howtos.</p>
<p>Stay tuned!</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-899').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/449520402" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/im-back-redesigned/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fim-back-redesigned%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/im-back-redesigned/</feedburner:origLink></item>
		<item>
		<title>Easily Updating WordPress with Subversion</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448671138/</link>
		<comments>http://wpguy.com/articles/easily-updating-wordpress-with-subversion/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 16:54:29 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[ssh]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[terminal]]></category>

		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=31</guid>
		<description><![CDATA[Lately I was having a lot of trouble updating the WordPress installs on all the blogs that I manage. Doing it with FTP can be extremely slow and time consuming. I used to upload the zipped WordPress directory and then unzipping and updating via SSH, however, this still was pretty complicated. I&#8217;ve been wanting to [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I was having a lot of trouble updating the WordPress installs on all the blogs that I manage. Doing it with FTP can be extremely slow and time consuming. I used to upload the zipped WordPress directory and then unzipping and updating via SSH, however, this still was pretty complicated. I&#8217;ve been wanting to try updating WordPress via Subversion for ages, and I finally did.<br />
<span id="more-31"></span><br />
There is <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion">an article about this</a> on the WordPress site, but I&#8217;m going to outline what worked for me.</p>
<h3>Connecting to your host via SSH</h3>
<p>First, you need to have access to your host via <a href="http://en.wikipedia.org/wiki/Secure_Shell">SSH</a>. If you don&#8217;t know how to do this, ask your hosting provider.</p>
<h3>Installing Subversion</h3>
<p>My MediaTemple DV server didn&#8217;t have Subversion installed, that&#8217;s one of the reasons I didn&#8217;t use it. So first, I had to install it. After a couple of hours of reading tutorials, installing packages and beating my head against the wall, I found out that you can get Subversion and other stuff by installing something they call &#8220;Developer Tools&#8221; from the admin panel.</p>
<p>Again, if you don&#8217;t have Subversion installed on your server, the best option is to ask your host.</p>
<h3>Seting up a Subversion repository</h3>
<p>For the sake of this tutorial let&#8217;s assume that your current WordPress install is at root level (&#8221;/WordPress&#8221;).</p>
<p>Here comes the fun part&#8230; Once you&#8217;re connected to your host via SSH you&#8217;ll have to create a temporary directory where we&#8217;re going to setup our repository (this varies depending on your setup):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> wp
<span style="color: #7a0874; font-weight: bold;">cd</span> wp</pre></div></div>

<p>Now download the latest WordPress version (currently 2.5.1):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.automattic.com<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>2.5.1<span style="color: #000000; font-weight: bold;">/</span> .</pre></div></div>

<p>To avoid problems later, I&#8217;m removing everything from the wp-content directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> wp-content<span style="color: #000000; font-weight: bold;">/</span>themes
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> wp-content<span style="color: #000000; font-weight: bold;">/</span>plugins
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> wp-content<span style="color: #000000; font-weight: bold;">/</span>index.php</pre></div></div>

<p>Then we&#8217;re going to copy the custom stuff from our current WordPress, that is, the themes, the plugins, the uploads, etc.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-rpf</span> <span style="color: #000000; font-weight: bold;">/</span>WordPress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/*</span> wp-content
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>WordPress<span style="color: #000000; font-weight: bold;">/</span>wp-config.php .htaccess .<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now we rename the old WordPress directory to something else and the new one to what the old one was called.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>WordPress <span style="color: #000000; font-weight: bold;">/</span>WordPress.bak
<span style="color: #c20cb9; font-weight: bold;">mv</span> wp <span style="color: #000000; font-weight: bold;">/</span>WordPress</pre></div></div>

<p><strong>That&#8217;s it</strong>. Check that your blog is still working, if something went wrong you can just revert to the old version by doing the last commands the other way around:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>WordPress <span style="color: #000000; font-weight: bold;">/</span>wp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>WordPress.bak <span style="color: #000000; font-weight: bold;">/</span>WordPress</pre></div></div>

<p>From now on, you can easily update using the following command (changing the &#8220;2.5.1&#8243; part to the appropriate version, of course):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> sw http:<span style="color: #000000; font-weight: bold;">//</span>svn.automattic.com<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>2.5.1<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>It sure is a complicated process if you don&#8217;t have much terminal / shell / ssh experience, but it&#8217;s definitely worth the effort.</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-896').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448671138" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/easily-updating-wordpress-with-subversion/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Feasily-updating-wordpress-with-subversion%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/easily-updating-wordpress-with-subversion/</feedburner:origLink></item>
		<item>
		<title>An archives page with all the posts in cronological order</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692268/</link>
		<comments>http://wpguy.com/articles/an-archives-page-with-all-the-posts-in-cronological-order/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 17:31:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[archives]]></category>

		<category><![CDATA[get_posts]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=30</guid>
		<description><![CDATA[An archive page is nothing more than a page with links to your blog posts ordered by date, category, etc. In this tutorial we&#8217;re going to list all the blog posts in our blog, ordered by date in a hierarchical way.

Something like this:


		May 2008

25 - Lorem ipsum
12 - Dolor sit amet



		April 2008

22 - Adipiscing elit
18 [...]]]></description>
			<content:encoded><![CDATA[<p>An archive page is nothing more than a page with links to your blog posts ordered by date, category, etc. In this tutorial we&#8217;re going to list all the blog posts in our blog, ordered by date in a hierarchical way.<br />
<span id="more-30"></span><br />
Something like this:</p>
<ul>
<li>
		May 2008</p>
<ul>
<li>25 - Lorem ipsum</li>
<li>12 - Dolor sit amet</li>
</ul>
</li>
<li>
		April 2008</p>
<ul>
<li>22 - Adipiscing elit</li>
<li>18 - Consectetur</li>
<li>3 - Ipsum amet</li>
</ul>
</li>
<li>&#8230;</li>
</ul>
<p>Cool, eh! Let&#8217;s go&#8230;</p>
<h3>The page</h3>
<p>First create a new php file and type this at the very beginning:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: Hierarchical Archives
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This will help us identify the template when we create the archives page in the WordPress back-end.</p>
<p>Now, let&#8217;s enter the basic page code. You may want to open the <strong>page.php</strong> file of your theme, and copy the structure. I&#8217;ll be using the default &#8220;kubrick&#8221; theme structure for this tutorial:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;content&quot; class=&quot;widecolumn&quot;&gt;
&nbsp;
&lt;!--Here is where our code will go--&gt;
&nbsp;
&lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>The code</h3>
<p>Ok and now this is the code that will print the actual list of posts:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Declare some helper vars</span>
<span style="color: #000088;">$previous_year</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0</span>;
<span style="color: #000088;">$previous_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0</span>;
<span style="color: #000088;">$ul_open</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Get the posts</span>
<span style="color: #000088;">$myposts</span> <span style="color: #339933;">=</span> get_posts<span style="color: #009900;">&#40;</span><span style="">'numberposts=-1&amp;orderby=post_date&amp;order=DESC'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myposts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>	
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Setup the post variables</span>
	setup_postdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #000088;">$year</span> <span style="color: #339933;">=</span> mysql2date<span style="color: #009900;">&#40;</span><span style="">'Y'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_date</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> mysql2date<span style="color: #009900;">&#40;</span><span style="">'n'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_date</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #000088;">$day</span> <span style="color: #339933;">=</span> mysql2date<span style="color: #009900;">&#40;</span><span style="">'j'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_date</span><span style="color: #009900;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$previous_year</span> || <span style="color: #000088;">$month</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$previous_month</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ul_open</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;/ul&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		&lt;h3&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="">'F Y'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
&nbsp;
		&lt;ul class=&quot;month_archive&quot;&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$ul_open</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$previous_year</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$year</span>; <span style="color: #000088;">$previous_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$month</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;li&gt;&lt;span class=&quot;the_day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="">'j'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;the_article&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/ul&gt;</pre></div></div>

<p>How does this work? Well&#8230; it&#8217;s a little hard to explain. Basically, we&#8217;re using the <a href="http://codex.wordpress.org/Template_Tags/get_posts">get_posts() function</a> to get all the posts (<strong>numberposts=0</strong> means all of them), ordered by date (<strong>orderby=post_date</strong>) in descending order (<strong>order=DESC</strong>). Then, we&#8217;re looping through every last one of them, comparing it&#8217;s published month and year to the previous one and echoing the year and the month accordingly.</p>
<h3>Wrapping up</h3>
<p>That&#8217;s basically it. Now save this file and upload it to your template directory (<strong>/wp-content/themes/your_theme</strong>). Then create a new page in the WordPress back-end, selecting &#8220;Hierarchical Archives&#8221; in the page template drop-down menu. And you&#8217;re done.</p>
<p>Hope you liked the pseudo-tutorial ;-).</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-516').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692268" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/an-archives-page-with-all-the-posts-in-cronological-order/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fan-archives-page-with-all-the-posts-in-cronological-order%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/an-archives-page-with-all-the-posts-in-cronological-order/</feedburner:origLink></item>
		<item>
		<title>An easy to remember login address</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692269/</link>
		<comments>http://wpguy.com/articles/an-easy-to-remember-login-address/#comments</comments>
		<pubDate>Thu, 29 May 2008 19:30:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[admin]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=29</guid>
		<description><![CDATA[Sometimes I find it pretty hard to type my WordPress Admin URL&#8230; you know &#8220;http://blogaddress.com/wp-admin.php&#8221; or &#8220;http://blogaddress.com/wp-admin/&#8220;&#8230; that&#8217;s too many dashes, points and slashes for my taste :-D.

If your server supports mod_rewrite (most servers do), you can shorten your login URL to just &#8220;login&#8221; by adding this rewrite directive to the .htaccess file in your [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I find it pretty hard to type my WordPress Admin URL&#8230; you know &#8220;http://blogaddress.com/<strong>wp-admin.php</strong>&#8221; or &#8220;http://blogaddress.com/<strong>wp-admin/</strong>&#8220;&#8230; that&#8217;s too many dashes, points and slashes for my taste :-D.<br />
<span id="more-29"></span><br />
If your server supports <a href="http://en.wikipedia.org/wiki/Mod_rewrite">mod_rewrite</a> (most servers do), you can shorten your login URL to just &#8220;<strong>login</strong>&#8221; by adding this rewrite directive to the <strong>.htaccess</strong> file in your blog directory:</p>

<div class="wp_syntax"><div class="code"><pre class="apache apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_rewrite.c&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteBase</span> /
<span style="color: #00007f;">RewriteRule</span> ^login$ /wp-login.php [L]
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<p>But wait, if your blog&#8217;s permalink structure is set to &#8220;pretty&#8221; permalinks, then, your <strong>.htaccess</strong> file has some rewrite rules already, in that case just add the RewriteRule directive right after the &#8220;RewriteBase /&#8221;. Like this:</p>

<div class="wp_syntax"><div class="code"><pre class="apache apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_rewrite.c&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteBase</span> /
&nbsp;
<span style="color: #00007f;">RewriteRule</span> ^login$ /wp-login.php [L]
&nbsp;
<span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} !-f
<span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} !-d
<span style="color: #00007f;">RewriteRule</span> . /index.php [L]
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<p>Make sure you save a back-up copy of the original <strong>.htaccess</strong> file (if there was one) before making these changes. You can never be too careful.</p>
<p>Also, make sure there isn&#8217;t a &#8220;login&#8221; directory.</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-359').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692269" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/an-easy-to-remember-login-address/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fan-easy-to-remember-login-address%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/an-easy-to-remember-login-address/</feedburner:origLink></item>
		<item>
		<title>How to make a random post button</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692270/</link>
		<comments>http://wpguy.com/articles/how-to-make-a-random-post-button/#comments</comments>
		<pubDate>Tue, 27 May 2008 18:26:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[posts]]></category>

		<category><![CDATA[random]]></category>

		<category><![CDATA[wpdb]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=28</guid>
		<description><![CDATA[Ever wanted to have a &#8220;Random Post&#8221; link or button in your sidebar but you don&#8217;t know where to start? Well, today I&#8217;m going to show you how to do it.

The principles
As you may know already, WordPress posts are stored in a MySQL database. For us to obtain the URL to a random post from [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to have a &#8220;Random Post&#8221; link or button in your sidebar but you don&#8217;t know where to start? Well, today I&#8217;m going to show you how to do it.<br />
<span id="more-28"></span></p>
<h3>The principles</h3>
<p>As you may know already, WordPress posts are stored in a MySQL database. For us to obtain the URL to a random post from that database, we need to run a MySQL query. It&#8217;s pretty simple actually, thanks to <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">WPDB</a>, a built-in database class that comes with every WordPress install, we don&#8217;t need to bother about database names, passwords, connections and disconnections, etc. We just need to run the query and echo the result.</p>
<h3>The MySQL query</h3>
<p>Our database query needs to look inside the posts table and select one random post from the published posts. This is what the query looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql mysql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> guid <span style="color: #993333; font-weight: bold;">FROM</span> wp_posts <span style="color: #993333; font-weight: bold;">WHERE</span> post_type <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'post'</span> <span style="color: #993333; font-weight: bold;">AND</span> post_status <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'publish'</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">RAND</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span></pre></div></div>

<p>Let me explain how exactly this MySQL query works:</p>
<ol>
<li><strong><code>SELECT guid</code></strong> - Select just the <strong>guid</strong> column value, which is where the URL to the post is located.</li>
<li><strong><code>FROM wp_posts</code></strong> - From the posts table</li>
<li><strong><code>WHERE post_type = 'post'</code></strong> - Since attachments are also saved in the posts table, we need to specify that we just want posts</li>
<li><strong><code>AND post_status = 'publish'</code></strong> - We just want the published posts, not scheduled posts, not drafts</li>
<li><strong><code>ORDER BY rand()</code></strong> - Get them in random order</li>
<li><strong><code>LIMIT 1</code></strong> - And get just one result</li>
</ol>
<h3>The PHP code</h3>
<p>Now, let&#8217;s type the PHP code. As I said, we&#8217;re going to make it simple by using the <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">WPDB class</a>, which comes bundled into WordPress. This is our code:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$randomPost</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT guid FROM $wpdb-&gt;posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">echo</span> <span style="">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$randomPost</span><span style="color: #339933;">.</span><span style="">'&quot;&gt;Random Post&lt;/a&gt;'</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>In the first line of the code, we&#8217;re running the database query using the <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">WPDB</a> <strong>get_var()</strong> function, and storing the result inside a <strong>$randomPost</strong> variable. Then, in the second line, we&#8217;re echoing the link, pointing to the URL stored in the <strong>$randomPost</strong> variable.</p>
<p>Note I&#8217;m using <strong>$wpdb->posts</strong> instead of <strong>wp_posts</strong>, that way, we make sure that we&#8217;re selecting the right table, since you could have changed the table prefix (which by default is &#8216;wp_&#8217;).</p>
<p>That&#8217;s it for today. I hope you enjoyed the mini-tutorial.</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-638').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692270" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/how-to-make-a-random-post-button/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fhow-to-make-a-random-post-button%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/how-to-make-a-random-post-button/</feedburner:origLink></item>
		<item>
		<title>Multiple tag / category queries</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692271/</link>
		<comments>http://wpguy.com/articles/multiple-tag-category-queries/#comments</comments>
		<pubDate>Mon, 26 May 2008 16:55:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[categories]]></category>

		<category><![CDATA[search]]></category>

		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=20</guid>
		<description><![CDATA[Did you know that WordPress supports multiple tag queries?

Let me explain. Imagine that you want to see all the posts tagged &#8220;music&#8221; and &#8220;apple&#8221;, well it&#8217;s as easy as:
http://yourblog.com/tag/music+apple
And if you want to see all posts tagged &#8220;music&#8221; or &#8220;apple&#8221; then:
http://yourblog.com/tag/music,apple
The same principle applies for categories.
Note: For those of you not using &#8220;pretty&#8221; permalinks, then [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that WordPress supports multiple tag queries?<br />
<span id="more-20"></span><br />
Let me explain. Imagine that you want to see all the posts tagged &#8220;music&#8221; and &#8220;apple&#8221;, well it&#8217;s as easy as:</p>
<p>http://<strong>yourblog.com</strong>/tag/<strong>music+apple</strong></p>
<p>And if you want to see all posts tagged &#8220;music&#8221; or &#8220;apple&#8221; then:</p>
<p>http://<strong>yourblog.com</strong>/tag/<strong>music,apple</strong></p>
<p>The same principle applies for categories.</p>
<p>Note: For those of you not using &#8220;pretty&#8221; permalinks, then it would be:</p>
<p>http://<strong>yourblog.com</strong>/?tag=<strong>music+apple</strong> or http://<strong>yourblog.com</strong>/?tag=<strong>music,apple</strong></p>
<p>The only problem with this is that there is no way (that I know of) for doing such queries except typing the url by hand.</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-250').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692271" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/multiple-tag-category-queries/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fmultiple-tag-category-queries%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/multiple-tag-category-queries/</feedburner:origLink></item>
		<item>
		<title>How to use initial caps in your WordPress theme</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692272/</link>
		<comments>http://wpguy.com/articles/how-to-use-initial-caps-in-your-theme/#comments</comments>
		<pubDate>Thu, 22 May 2008 07:03:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[function]]></category>

		<category><![CDATA[hook]]></category>

		<category><![CDATA[initial caps]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=24</guid>
		<description><![CDATA[Also called initial letters, initial caps are enlarged characters that are used as the first letter of a paragraph. Initial caps can be in a different font, different color, or you could even use images instead! In this tutorial we&#8217;re going to learn how to create initial caps using special HTML markup, CSS styling, and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpguy.com/wp-content/uploads/2008/05/initial_cap4.jpg" alt="Initial Cap" title="Initial Cap" width="300" height="92" class="alignleft size-medium wp-image-27" />Also called initial letters, initial caps are enlarged characters that are used as the first letter of a paragraph. Initial caps can be in a different font, different color, or you could even use images instead! In this tutorial we&#8217;re going to learn how to create initial caps using special HTML markup, CSS styling, and then we&#8217;re going to automate the process with a PHP function.<br />
<span id="more-24"></span></p>
<h3>The HTML</h3>
<p>In order to style the first letter of a paragraph differently, we need to wrap it inside a special HTML element that we can later style by adding a few lines of CSS. For this tutorial I&#8217;m going to use a simple <strong>span</strong> element, with the <strong>&#8220;initialcap&#8221;</strong> class. The resulting paragraph will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;initialcap&quot;</span>&gt;</span>L<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>orem ipsum dolor sit amet, ...</pre></div></div>

<p>Remember not to repeat the letter after the span <img src='http://wpguy.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h3>The CSS</h3>
<p>Here comes the tricky part, due to the fact that every theme has different font size and line height values you&#8217;ll have to adapt this part to your theme. I&#8217;m going to assume that our paragraph has a font-size of 14 pixels and a line height of 18 pixels.</p>
<p><strong>1. Float!</strong> We need to make our capital letter float left in order for the paragraph text to flow around it.</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;">span.initialcap<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span>;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>2. Font size.</strong> We assign it a font size of 40 pixels (again, this may vary depending on your theme&#8217;s CSS), and a line height of 35 pixels, which is twice the line height of the paragraph minus 1 pixel (just in case).</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;">span.initialcap<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span>;
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span>; <span style="color: #808080; font-style: italic;">/* Double the line height minus 1 pixel */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>3. Extra styling.</strong> We&#8217;re going to use a serif font, make it blue, and add a little bit of spacing on the right.</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;">span.initialcap<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span>;
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span>; <span style="color: #808080; font-style: italic;">/* Double the line height minus 1 pixel */</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span>;
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2583ad</span>; <span style="color: #808080; font-style: italic;">/* Blue */</span>
    <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span>;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>You&#8217;re probably going to have to play a little bit with the font size and line height values though.</p>
<h3>Automation</h3>
<p>Ok, so you&#8217;ve added the necessary CSS to your <strong>style.css</strong> file, but isn&#8217;t it a bit of a hassle to have to add the HTML markup every time you write a new post? Well, this bit of PHP code will do this for you:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wpguy_initial_cap<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Regular Expression, matches a single letter</span>
    <span style="color: #666666; font-style: italic;">// * even if it's inside a link tag.</span>
    <span style="color: #000088;">$searchfor</span> <span style="color: #339933;">=</span> <span style="">'/&gt;(&lt;a [^&gt;]+&gt;)?([^&lt;s])/'</span>;
&nbsp;
    <span style="color: #666666; font-style: italic;">// The string we're replacing the letter for</span>
    <span style="color: #000088;">$replacewith</span> <span style="color: #339933;">=</span> <span style="">'&gt;$1&lt;span class=&quot;capital&quot;&gt;$2&lt;/span&gt;'</span>;
&nbsp;
    <span style="color: #666666; font-style: italic;">// Replace it, but just once (for the very first letter of the post)</span>
    <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$searchfor</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replacewith</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;
&nbsp;
    <span style="color: #666666; font-style: italic;">// Return the result</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Add this function to the WordPress hook</span>
add_filter<span style="color: #009900;">&#40;</span><span style="">'the_content'</span><span style="color: #339933;">,</span> <span style="">'wpguy_initial_cap'</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p><strong>How does it work?</strong> Basically, our function takes the content of the blog post, and wraps the first letter with our special markup.</p>
<p>All you need to do is paste it inside the <strong>functions.php</strong> file of your theme.</p>
<p>I hope you enjoyed this tutorial! Remember to post your thoughts and questions in the Comments section.</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-589').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692272" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/how-to-use-initial-caps-in-your-theme/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fhow-to-use-initial-caps-in-your-theme%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/how-to-use-initial-caps-in-your-theme/</feedburner:origLink></item>
		<item>
		<title>How to display a random ‘Read More’ link</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692273/</link>
		<comments>http://wpguy.com/articles/how-to-display-a-random-read-more-link/#comments</comments>
		<pubDate>Wed, 21 May 2008 15:44:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[read more]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=18</guid>
		<description><![CDATA[Alert! This tip is more fun than useful.
Ever wanted to display a random &#8220;Read More&#8230;&#8221; link on your blog homepage? Here&#8217;s some code that&#8217;ll help you do just that.

The strings
Copy and paste this code somewhere in the index.php or functions.php file of your theme (but make sure you paste it before the loop):

&#60;?php $more_strings = [...]]]></description>
			<content:encoded><![CDATA[<p>Alert! This tip is more fun than useful.</p>
<p>Ever wanted to display a random &#8220;Read More&#8230;&#8221; link on your blog homepage? Here&#8217;s some code that&#8217;ll help you do just that.<br />
<span id="more-18"></span></p>
<h3>The strings</h3>
<p>Copy and paste this code somewhere in the index.php or functions.php file of your theme (but make sure you paste it before the loop):</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$more_strings</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Read More...&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Keep on Reading...&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Wait! There's more...&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Read the rest of the article...&quot;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You can add as many strings as you want.</p>
<p>Then change the the_content(); bit to this:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">the_content<span style="color: #009900;">&#40;</span><span style="color: #000088;">$more_strings</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color:#800080;">0</span><span style="color: #339933;">,</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$more_strings</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>That&#8217;s it&#8230; Have fun!</p>
<script type="text/javascript">
				<!--
				document.getElementById('email-739').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692273" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/how-to-display-a-random-read-more-link/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fhow-to-display-a-random-read-more-link%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/how-to-display-a-random-read-more-link/</feedburner:origLink></item>
		<item>
		<title>My First (free) Theme: Pistachio</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/293719764/</link>
		<comments>http://wpguy.com/themes/pistachio-theme/#comments</comments>
		<pubDate>Mon, 19 May 2008 19:24:49 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Themes]]></category>

		<category><![CDATA[free]]></category>

		<category><![CDATA[green]]></category>

		<category><![CDATA[pistachio]]></category>

		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=21</guid>
		<description><![CDATA[
It&#8217;s only been 2 weeks since I launched wpguy.com, but I&#8217;ve managed to design and develop my first free WordPress theme!

Features
It&#8217;s called Pistachio (?), and these are some of the features included:

3 Columns
Unique icons
Widget ready sidebars
Gravatar ready
Separated trackbacks and comments
Author comments highlight
Archives page template
Compatible with WordPress 2.3 and up
Valid CSS and XHTML

Installation
To install the Pistachio [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://wpguy.com/themes/pistachio-theme/'><img src="http://wpguy.com/wp-content/uploads/2008/05/pistachio2.jpg" alt="Pistachio Theme" title="Pistachio Theme" class="alignnone size-full wp-image-23" width="460" height="230" /></a></p>
<p>It&#8217;s only been 2 weeks since I launched wpguy.com, but I&#8217;ve managed to design and develop my first free WordPress theme!<br />
<span id="more-21"></span></p>
<h3>Features</h3>
<p>It&#8217;s called Pistachio (<a href="http://en.wikipedia.org/wiki/Pistachio">?</a>), and these are some of the features included:</p>
<ul>
<li>3 Columns</li>
<li>Unique icons</li>
<li>Widget ready sidebars</li>
<li>Gravatar ready</li>
<li>Separated trackbacks and comments</li>
<li>Author comments highlight</li>
<li>Archives page template</li>
<li>Compatible with WordPress 2.3 and up</li>
<li>Valid CSS and XHTML</li>
</ul>
<h3>Installation</h3>
<p>To install the Pistachio theme just follow these easy steps:</p>
<ol>
<li>Unzip the pistachio.zip file.</li>
<li>Upload the resulting pistachio folder to the /wp-content/themes/ directory of your WordPress install</li>
<li>Log into your blog admin and go to the Presentation > Theme area</li>
<li>Find the Pistachio theme and activate it by clicking on it&#8217;s thumbnail</li>
<li>That&#8217;s it, enjoy!</li>
</ol>
<h3>Preview and Download</h3>
<p><a class="demo" href="/demo/?wptheme=pistachio">Pistachio Demo</a><br />
<a class="download" href="/files/themes/pistachio.zip">Download Pistachio 1.0</a></p>
<h3>Donate</h3>
<p>If you like Pistachio, please consider making a small donation:</p>
<p><a href="http://wpguy.com/donate/WP+Guy:+Pistachio+Theme"><img src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" alt="donate" /></a></p>
<script type="text/javascript">
				<!--
				document.getElementById('email-268').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/293719764" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/themes/pistachio-theme/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Fthemes%2Fpistachio-theme%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/themes/pistachio-theme/</feedburner:origLink></item>
		<item>
		<title>Don’t forget your navigation links</title>
		<link>http://feeds.feedburner.com/~r/wpguy/~3/448692274/</link>
		<comments>http://wpguy.com/articles/dont-forget-your-navigation-links/#comments</comments>
		<pubDate>Thu, 15 May 2008 17:00:00 +0000</pubDate>
		<dc:creator>Wessley Roche</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[navigation]]></category>

		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://wpguy.com/?p=19</guid>
		<description><![CDATA[Picture this: You&#8217;ve been surfing the web for a little while, and end up in this great blog that seems to have lots of useful articles. But wait&#8230; There are no previous/next links after the tenth article! You&#8217;re doomed. Your only option now seems to be going through each and every category, or each and [...]]]></description>
			<content:encoded><![CDATA[<p>Picture this: You&#8217;ve been surfing the web for a little while, and end up in this great blog that seems to have lots of useful articles. But wait&#8230; There are no previous/next links after the tenth article! You&#8217;re doomed. Your only option now seems to be going through each and every category, or each and every month in the archives page.<br />
<span id="more-19"></span><br />
Sounds stupid, I know, but if I you gave me a penny for every blog I have visited that didn&#8217;t have previous/next links, I&#8217;d be rich by now. It&#8217;s so frustrating!</p>
<p>So remember your navigation links! Here is how to generate them in WordPress:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #009900;">&#40;</span><span style="">'&amp;laquo; Older Entries'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #009900;">&#40;</span><span style="">'Newer Entries &amp;raquo;'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<script type="text/javascript">
				<!--
				document.getElementById('email-366').value="&#119;&#101;&#115;&#64;&#119;&#112;&#103;&#117;&#121;&#46;&#99;&#111;&#109;";
				// -->
				</script><img src="http://feeds.feedburner.com/~r/wpguy/~4/448692274" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wpguy.com/articles/dont-forget-your-navigation-links/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=wpguy&amp;itemurl=http%3A%2F%2Fwpguy.com%2Farticles%2Fdont-forget-your-navigation-links%2F</feedburner:awareness><feedburner:origLink>http://wpguy.com/articles/dont-forget-your-navigation-links/</feedburner:origLink></item>
	<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=wpguy</feedburner:awareness></channel>
</rss>
