<?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>ANDY STRATTON&#187; Wordpress</title>
	<atom:link href="http://theandystratton.com/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://theandystratton.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 09 Sep 2010 15:23:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>BuddyPress Avatars Not Displaying with WordPress&#160;3.0</title>
		<link>http://theandystratton.com/2010/buddypress-avatars-not-displaying-with-wordpress-3-0</link>
		<comments>http://theandystratton.com/2010/buddypress-avatars-not-displaying-with-wordpress-3-0#comments</comments>
		<pubDate>Thu, 09 Sep 2010 15:13:26 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=488</guid>
		<description><![CDATA[I don&#8217;t work with BuddyPress much if at all, but have been doing a lot more of it lately. Recently, we had an issue where avatars were not displaying on pages using the built-in template tags, like bp_member_avatar() and others. We thought this was a weird environment issue at first, but then I found this [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t work with BuddyPress much if at all, but have been doing a lot more of it lately. Recently, we had an issue where avatars were not displaying on pages using the built-in template tags, like <code>bp_member_avatar()</code> and others.</p>
<p>We thought this was a weird environment issue at first, but then I found <a href="http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/custom-avatars-not-showing-on-multisite-blogs/" rel="external">this post</a> that showed me it&#8217;s a common issue that&#8217;s been reported to their development team.</p>
<p>I continued searching for a solution and got some direction <a href="http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/custom-avatars-arent-shown-on-single-blogs-in-wpmu/" rel="external">from a solution</a> by <a href="http://buddypress.org/community/members/foralien/" rel="external">@foralien</a> on the BuddyPress forums. Her solution did not work for, but I created my own version and had success.</p>
<h2>What was happening?</h2>
<p>Our BuddyPress installation was trying to get avatars from <code>/blogs.dir/1/files/avatars/{$user_id}/{$filename}</code> – which did not eve exist, this was referencing a files directory for the root blog and it didn&#8217;t even exist.</p>
<p>As per <a href="http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/custom-avatars-arent-shown-on-single-blogs-in-wpmu/" rel="external">@foralien&#8217;s solution</a>, I created 2 filters (one for the avatar path, the other for the avatar public URL):</p>
<p><a href="/downloads/bp-avatar-filters.txt"><strong>Download the Code</strong></a></p>
<pre class="brush: php;">// Custom filters to clean up issues in WP 3.0 with avatar paths.
// Written by @theandystratton
function sizeable_bp_core_avatar_folder_dir( $path ) {
	$items = explode('/', $path);
	$path = ABSPATH . 'wp-content/uploads/avatars/' . end($items);
	return $path;
}
add_filter('bp_core_avatar_folder_dir', 'sizeable_bp_core_avatar_folder_dir');
function sizeable_bp_core_avatar_folder_url( $url ) {
	$items = explode('/', $url);
	$url = 'http://' . $items[2] . '/wp-content/uploads/avatars/' . end($items);
	return $url;
}
add_filter('bp_core_avatar_folder_url', 'sizeable_bp_core_avatar_folder_url');</pre>
<h2>What it&#8217;s doing</h2>
<p>We&#8217;re filtering the path and the url for avatars to ensure it&#8217;s using the WP 3.0 location, which is the upload_path for the root site followed by <code>/avatars/{$user_id}</code>. This is <em>not</em> a forever fix. I&#8217;d use it as duct tape until they release a BuddyPress update for WP 3.0 fixing the issue.</p>
<p>Hope this helps you guys and saves you some time and frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2010/buddypress-avatars-not-displaying-with-wordpress-3-0/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shared Hosting Fix&#8230; Uhm,&#160;fix.</title>
		<link>http://theandystratton.com/2010/shared-hosting-fix-uhm-fix</link>
		<comments>http://theandystratton.com/2010/shared-hosting-fix-uhm-fix#comments</comments>
		<pubDate>Wed, 30 Jun 2010 02:47:30 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=434</guid>
		<description><![CDATA[So I&#8217;ve had some reports that the shared hosting hack fix that I wrote as a quick bridge to a real solution left some people with PHP documents that contained a bit of leading whitespace, which can really b0rk up your WordPress install or any PHP application if it&#8217;s in the right file the wrong [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve had some reports that the <a href="http://theandystratton.com/2010/shared-godaddy-hosting-wordpress-malware-hack-fix">shared hosting hack fix</a> that I wrote as a quick bridge to a <a href="http://theandystratton.com/2010/shared-godaddy-hosting-wordpress-malware-hack-fix#do-more">real solution</a> left some people with PHP documents that contained a bit of leading whitespace, which can really b0rk up your WordPress install or any PHP application if it&#8217;s in the right file the wrong way.</p>
<p>So, I give you the cleaner (special thanks to Michael Safovich for requesting and testing).</p>
<h3>What&#8217;s it do</h3>
<p>It recursively looks through it&#8217;s current directory (and subdirectories) for PHP files (by default it&#8217;s looking for <code>php</code>, <code>php4</code>, <code>php5</code> and <code>phtml</code> extensions, but this is customizable) and killing any whitespace in the beginning of the file, turning:</p>
<pre><code>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&lt;?php include_once './wp-blog-header.php'; ?&gt;</code></pre>
<p>into this:</p>
<pre><code>&lt;?php include_once './wp-blog-header.php'; ?&gt;</code></pre>
<p>Make sense? Good, here&#8217;s the <a href="/downloads/cleaner.zip">download link</a>.</p>
<h3>Tips &amp; Customization</h3>
<p>BACK UP YOUR FILES. You agree to take responsibility for running this, because I sure don&#8217;t (though I think you&#8217;ll be fine).</p>
<p>To run on custom file types, edit the <code>$fileTypes</code> array to include the types you want to strip leading whitespace from.</p>
<p>The script will run for the current directory. You will need to set the <code>$directory</code> variable to contain the path you&#8217;d like to recursively clean, in most cases you&#8217;d drop the <code>cleaner.php</code> file in your document root and hit it in the browser.</p>
<p>It will run immediately and output a log. Hope it helps. ¡Hasta luego!</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2010/shared-hosting-fix-uhm-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated: Shared PHP Hosting &amp; WordPress Malware Hack&#160;Fix</title>
		<link>http://theandystratton.com/2010/shared-godaddy-hosting-wordpress-malware-hack-fix</link>
		<comments>http://theandystratton.com/2010/shared-godaddy-hosting-wordpress-malware-hack-fix#comments</comments>
		<pubDate>Tue, 18 May 2010 03:55:47 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=407</guid>
		<description><![CDATA[*UPDATE* Reports of leading whitespace being left in the files after the fix script has been ran led me to build the cleaner, a script to, well clean up that leading whitespace. I have also updated the download of the fix on this page to strip leading white space. So GoDaddy wasn&#8217;t the only host [...]]]></description>
			<content:encoded><![CDATA[<div style="border:1px solid #ccc;background:#f7f7a7;padding:1em"><strong>*UPDATE*</strong> Reports of leading whitespace being left in the files after the fix script has been ran led me to build <a href="http://theandystratton.com/2010/shared-hosting-fix-uhm-fix">the cleaner</a>, a script to, well clean up that leading whitespace.</p>
<p>I have also updated the download of <a href="/downloads/2010-hack/shared-hosting-fix.php.txt">the fix on this page</a> to strip leading white space.</div>
<p>So <a href="http://godaddy.com" rel="external nofollow">GoDaddy</a> wasn&#8217;t the only host attacked by this malware PHP hack. I&#8217;ve found traces on client&#8217;s <a href="http://www.bluehost.com" rel="external nofollow">BlueHost shared Linux hosting</a> as well. Apparently some other hosts, including <a href="http://www.networksolutions.com" rel="external nofollow">Network Solutions</a>. </p>
<p>One host I use (along with multiple clients) who I haven&#8217;t seen or heard about being affected is <a href="http://www.hostgator.com" rel="external nofollow">HostGator</a>. My dedicated box(es) have not been affected either.</p>
<p>This is NOT an issue exclusive to WordPress installs. Tons of WordPress installations have been affected but WordPress is currently the most-installed PHP/MySQL web application on the web today, especially in these shared Linux hosting environments. I&#8217;ve seen this same attack affect sites with basic PHP files using only <code>include</code> statements as well as other PHP/MySQL applications such as <span title="Joomla really">Joomla</span> (<em>*shudder*</em>).</p>
<h2>What the attack seems to be doing</h2>
<ul>
<li>Adding a line of <code>base64</code> encrypted PHP to be evaluated before most PHP scripts run</li>
<li>Common strings in hacked files include:
<ul>
<li><code>&lt;?php eval(base64_decode(</code></li>
<li><code>&lt;?php eval(gzinflate(base64_decode(</code></li>
</ul>
<li>Some of this code is injecting content into your page&#8217;s output for search engines, some redirecting users</li>
<li>I&#8217;ve found some sites commonly have the file <code>./wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/style.css.php</code> which is a lot of <code>eval()</code> wrapped <code>base64</code> encoded strings (it&#8217;s been recursively encrypted and after 15 iterations I needed to get back to client work)</li>
<li>I also found some files without extensions in the <code>./wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/</code> directory (<a href="/downloads/2010-hack/t.txt">t (looks to be a template)</a>, <a href="/downloads/2010-hack/lb.txt">lb (links, link back perhaps?)</a> and <a href="/downloads/2010-hack/kwd.txt">kwd (keywords)</a> &mdash; there was also a file named <code>cnf</code> which looked to be encrypted configuration for the hack as well as another file called <code>csi</code> which contained an IP and Unix timestamp.</li>
</ul>
<h2>Updated Fix for the Hosting Hack</h2>
<p>Please note: this is not an all comprehensive fix. This can help clear out some code very quickly but you should still take some drastic efforts (<a href="#do-more">see below</a>) to clean up your site and protect yourself.</p>
<h3><a href="/downloads/2010-hack/shared-hosting-fix.php.txt">Download Shared Hosting Attack Fix &raquo;</a></h3>
<p><strong>Instructions:</strong></p>
<ol>
<li><strong>Make time <em>this week</em> to figure out and implement a plan for backing up your site and database,</strong> either via your hosting provider, your own shell scripts, or <a href="http://www.vaultpress.com" rel="external nofollow">VaultPress.com</a> is looking very good right now if you&#8217;re on WordPress.</li>
<li><strong>Back up your site files.</strong> Even if they are hacked, get a copy of everything locally just in case.</li>
<li>Download <a href="/downloads/2010-hack/shared-hosting-fix.php.txt"><code>shared-hosting-fix.php.txt</code></a> and rename it <code>shared-hosting-fix.php</code></li>
<li>Place the file somewhere in your document root and visit it in a browser to review what files are <q>infected</q>. If you&#8217;re not seeing affected files here, make sure the contents of the <code>$hack_str</code> variable on line 30 is the same as the beginning of the hack&#8217;s code. Some have been different by a space here and there, which will affect this clean up script.</li>
<li>If you have infected files, you can press the &#8220;Fix Files&#8221; button at the bottom of the page to start the automated task of removing the first line of malicious code</li>
<li>Confirm that you want to make the changes on the popups and you will see a simple log display when all is said and done</li>
<li>Back up your clean(er) files and <a href="#do-more">take more steps to audit your files and database</a> to try to avoid recurrence</li>
</ol>
<h2 id="do-more">Do More to Clean Up and Protect Yourself (WordPress)</h2>
<p>Just a few notes about other things you can (and should) do:</p>
<ul>
<li><strong>Make regular backups</strong> &mdash; Lazy? Checkout <a href="http://vaultpress.com" rel="external">VaultPress</a></li>
<li><strong>Clear any and all cache files on your server.</strong> I&#8217;d literally de-activate the caching plugins, remove them and their associated directories and then download and re-install them</li>
<li>Back up your <code>wp-config.php</code> file and <code>wp-content</code> directory then completely remove all of your WordPress files and directories, then re-upload from a fresh and up-to-date <a href="http://wordpress.org/latest.zip" rel="external nofollow">WordPress install</a>. <strong>Audit your <code>wp-content</code> directories and <code>wp-config.php</code> file</strong> before re-uploading.</li>
<li>Use some WP Security plugins:
<ul>
<li><a href="http://wordpress.org/extend/plugins/wp-security-scan/" rel="external nofollow">WP Security Scan</a></li>
<li><a href="http://wordpress.org/extend/plugins/wordpress-file-monitor/" rel="external nofollow">WordPress File Monitor</a></li>
<li><a href="http://wordpress.org/extend/plugins/exploit-scanner/" rel="external nofollow">WordPress Exploit Scanner</a></li>
</ul>
</li>
<li>Check your database, specifically the <code>wp_options</code> table for suspicious code (see Chris Pearson&#8217;s post below, <a href="http://www.pearsonified.com/2010/04/wordpress-pharma-hack.php" rel="external nofollow">How to Diagnose and Remove the WordPress Pharma Hack</a></li>
</ul>
<h2>WordPress Security Reference Links</h2>
<p>Thanks to some friends at <a href="http://automattic.com" rel="external nofollow">Automattic</a> and in the WordPress community, here are some links for your reference:</p>
<ul>
<li><a href="http://www.slideshare.net/williamsba/wordpress-security-1709496" rel="external nofollow">WordPress Security Presentation</a><br />A great WP security presentation by Brad Williams of <a href="http://webdevstudios.com/" rel="external nofollow">WebDevStudios</a></li>
<li><a href="http://codex.wordpress.org/Hardening_WordPress#Securing_wp-admin" rel="external nofollow">Securing wp-admin</a></li>
<li><a href="http://codex.wordpress.org/Hardening_WordPress#Securing_wp-config.php" rel="external nofollow">Securing wp-config.php</a></li>
<li><a href="http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content" rel="external nofollow">Moving wp-content</a></li>
<li><a href="http://codex.wordpress.org/Installing_WordPress_With_Clean_Subversion_Repositories" rel="external nofollow">Installing WP with Clean SVN Repositories</a></li>
<li>If you&#8217;re a busy, well-to-do, business person who just doesn&#8217;t have the time, you could <a href="/contact?quote">contact and hire</a> a <a href="http://theandystratton.com">outstanding WordPress and PHP developer</a> and occasional blogger&hellip; <code>&lt;/shamless_self_promotion&gt;</code>
</ul>
<h2>Some Reference Posts For Reading:</h2>
<ul>
<li><a href="http://www.wpsecuritylock.com/dangerous-malware-alert-hacked-godaddy-responds/" rel="external nofollow">CONTINUING STORY – Dangerous Malware Alert – Self-Hosted Sites Hack Update –  Go Daddy Responds! | WPSecurityLock</a></li>
<li><a href="http://blog.sucuri.net/2010/05/simple-cleanup-solution-for-latest.html" rel="external nofollow">Simple cleanup solution for the latest WordPress hack</a></li>
<li><a href="http://smackdown.blogsblogsblogs.com/2010/05/13/hosting-with-godaddy-might-want-to-rethink-that-decision/" rel="external nofollow">http://smackdown.blogsblogsblogs.com/2010/05/13/hosting-with-godaddy-might-want-to-rethink-that-decision/</a></li>
<li><a href="http://www.pearsonified.com/2010/04/wordpress-pharma-hack.php" rel="external nofollow">How to Diagnose and Remove the WordPress Pharma Hack</a></li>
<li><a href="http://www.blogtips.org/how-to-cure-your-godaddy-wordpress-hacked-blog/" rel="nofollow external">How to cure your GoDaddy WordPress hacked blog</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2010/shared-godaddy-hosting-wordpress-malware-hack-fix/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>The Permalinker WordPress Plugin: Dynamic&#160;Permalinks</title>
		<link>http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks</link>
		<comments>http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks#comments</comments>
		<pubDate>Tue, 30 Jun 2009 18:48:21 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=181</guid>
		<description><![CDATA[As a developer, I&#8217;ve always found permalinks and directory structures between local, staging, and production environments to be a pain. Creating links within content requires either absolute (http://yourdomain.com/path/to/post/) or a non-domain-specific absolute (/install/directory/path/to/post) URLs. This can prove to be a pain during the development or migration process. It can also make it annoying if you [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer, I&#8217;ve always found permalinks and directory structures between local, staging, and production environments to be a pain. Creating links within content requires either absolute (<code>http://yourdomain.com/path/to/post/</code>) or a non-domain-specific absolute (/install/directory/path/to/post) URLs.</p>
<p>This can prove to be a pain during the development or migration process. It can also make it annoying if you happen to change your permalink structure and have tons of posts.</p>
<p><strong class="header">Introducing dynamically inserted WordPress permalinks with The Permalinker</strong></p>
<p><a href="http://wordpress.org/extend/plugins/the-permalinker/" rel="external">The Permalinker</a> will allow you to use <a href="http://faq.wordpress.com/2008/06/18/what-are-the-wordpress-shortcodes/" rel="external">WordPress short codes</a> to dynamically insert permalinks and permalink URLs into your posts via the content editor.</p>
<p><strong>How it works:</strong></p>
<p>When editing content, simply use the the <code><a href="http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks" class="permalinker_link"></code> short code to insert a link:</p>
<pre><code>[permalink]This is a link to the current post</a></code></pre>
<p><strong>Linking to a different post:</strong></p>
<p>You can set the <code>id</code> attribute in the short code to point to a specific page/post:</p>
<pre><code><a href="http://theandystratton.com/2009/9-revision-3" class="permalinker_link">A link to post 23</a></code></pre>
<p><strong>Supported anchor attributes:</strong></p>
<p>Currently, the following attributes are supported in the <code><a href="http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks" class="permalinker_link"></code> short code and will be added to the resulting anchor element: <code>class</code>, <code>rel</code>, and <code>target</code>.</p>
<pre><code>[permalink id=23 class="my_class" rel="self" target="_blank"]Open post 23 in a new window</a></code></pre>
<p><strong>Want more control over your markup?</strong></p>
<p>Using a non-terminating or empty <code>http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks</code> short code will simply output the permalink URL:</p>
<pre><code>&lt;a href="http://theandystratton.com/2009/9-revision-3" class="thickbox" id="link_23">Another link to page/post 23&lt;/a&gt;</code></pre>
<p><strong class="header">There&#8217;s more: Dynamically grab your template directory</strong></p>
<p>As a request from fellow WordPress designers and developers, I&#8217;ve included a <code>http://theandystratton.com/wp-content/themes/theandystratton</code> short code as well, allowing you to quickly and dynamically get the full URL to your active template directory from the content editor:</p>
<pre><code>&lt;img src="http://theandystratton.com/wp-content/themes/theandystratton/photos/yoda.gif" alt="A picture of Yoda!" /&gt;</code></pre>
<p><strong class="header">Download Permalinker</strong></p>
<p>You can learn more and <a href="http://wordpress.org/extend/plugins/the-permalinker" rel="external">download The Permalinker</a> from the WordPress plugin repository.</p>
<p>Happy coding ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Show total number of search results in your WordPress search&#160;template</title>
		<link>http://theandystratton.com/2009/show-total-search-results-wordpress-search-template</link>
		<comments>http://theandystratton.com/2009/show-total-search-results-wordpress-search-template#comments</comments>
		<pubDate>Sat, 06 Jun 2009 18:58:51 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=163</guid>
		<description><![CDATA[In prepping the new site design for theandystratton.com, I wanted to show the total number of search results on my search page. I started by displaying a count($posts), but since I&#8217;ve got my installation showing 5 posts per page, that consistently displayed 5 or less posts. Less than desirable. So, the next step was duplicating [...]]]></description>
			<content:encoded><![CDATA[<p>In prepping the new site design for <a href="http://theandystratton.com" rel="me">theandystratton.com</a>, I wanted to show the total number of search results on my search page.</p>
<p>I started by displaying a <code>count($posts)</code>, but since I&#8217;ve got my installation showing 5 posts per page, that consistently displayed 5 or less posts. Less than desirable.</p>
<p>So, the next step was duplicating the search query so I could get the count, and as usual I like to try to use the WordPress functions as opposed to touching the database directly:</p>
<pre class="brush: php;">&amp;lt;?php
$tmp_search = new WP_Query('s=' . wp_specialchars($_GET['s']) . '&amp;amp;show_posts=-1');
$count = $tmp_search-&amp;gt;post_count;
echo $count . ' results for ' . htmlentities($_GET['s']) . '.';
?&amp;gt;</pre>
<p>Unfortunately, the code above still gave me the wrong count. Why? My settings were still set to 5 posts per page; and the WP Query object as assuming this constraint.</p>
<p><strong>The Solution:</strong> send <code>posts_per_page=-1</code> as part of the query.</p>
<pre class="brush: php;">&amp;lt;?php
$tmp_search = new WP_Query('s=' . wp_specialchars($_GET['s']) . '&amp;amp;show_posts=-1&amp;amp;posts_per_page=-1');
$count = $tmp_search-&amp;gt;post_count;
echo $count . ' results for ' . htmlentities($_GET['s']) . '.';
?&amp;gt;</pre>
<p>&hellip;and there you have it. A nice functional search results page. For even further refinement, I&#8217;m limiting my search to blog posts, and excluding pages by including <code>post_type=post</code> in my query.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/show-total-search-results-wordpress-search-template/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Get WordPress Permalinks Working with Windows, IIS, and ISAPI&#160;Rewrite</title>
		<link>http://theandystratton.com/2009/get-wordpress-permalinks-working-with-windows-iis-and-isapi-rewrite</link>
		<comments>http://theandystratton.com/2009/get-wordpress-permalinks-working-with-windows-iis-and-isapi-rewrite#comments</comments>
		<pubDate>Wed, 29 Apr 2009 03:09:56 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=111</guid>
		<description><![CDATA[The eternal battle is over, mostly: getting your WordPress permalinks to work on your Windows IIS web server with ISAPI Rewrite installed. Some Requirments. Sorry, but you&#8217;re going to need ISAPI Rewrite 3. You can download a lite version for free, but I suggest purchasing it. I&#8217;ve used ISAPI Rewrite for years now with clients [...]]]></description>
			<content:encoded><![CDATA[<p>The eternal battle is over, mostly: getting your WordPress permalinks to work on your Windows IIS web server with ISAPI Rewrite installed.</p>
<p><strong>Some Requirments.</strong></p>
<ol>
<li>Sorry, but you&#8217;re going to need <a href="http://www.helicontech.com/isapi_rewrite/" rel="external">ISAPI Rewrite 3</a>. You can download a lite version for free, but I suggest purchasing it. I&#8217;ve used ISAPI Rewrite for years now with clients on Windows hosting, and it&#8217;s the bees knees. Version 3 is now supporting many common mod_rewrite directives, which is sweet.</li>
<li>Your <code>.htaccess</code> file. Here&#8217;s an example that has worked with WordPress 2.7.x, ISAPI Rewrite 3, and Windows Server 2003/IIS 6.0:
<pre class="brush: plain;">
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]
</pre>
</li>
</ol>
<p><strong>How it works.</strong><br />
Even with ISAPI Rewrite, your WordPress permalinks most likely will be broken without the ugly, prepended <code>/index.php/</code>. The problem is that the <code>REQUEST_URI</code> server variable is not sent by IIS or ISAPI Rewrite. This plugin solves this.</p>
<p>This solution is more elegant that changing the WordPress core files because it allows you to easily upgrade WordPress without additional maintenance.</p>
<p><strong>Download and Documentation.</strong><br />
You can <a href="http://downloads.wordpress.org/plugin/isapi-rewriter.zip" rel="external">download ISAPI Rewriter</a> from the <a href="http://wordpress.org/extend/plugins/" rel="external">WordPress Plugin</a> directory.</p>
<p>You can view documentation at the <a href="http://wordpress.org/extend/plugins/isapi-rewriter/" rel="external">ISAPI Rewrite plugin</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/get-wordpress-permalinks-working-with-windows-iis-and-isapi-rewrite/feed</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>WPLookup makes its way to WordPress&#8217; IRC&#160;Channel</title>
		<link>http://theandystratton.com/2009/wplookup-makes-its-way-to-wordpress-irc-channel</link>
		<comments>http://theandystratton.com/2009/wplookup-makes-its-way-to-wordpress-irc-channel#comments</comments>
		<pubDate>Fri, 06 Mar 2009 15:02:18 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[wplookup]]></category>

		<guid isPermaLink="false">http://theandystratton.com/?p=74</guid>
		<description><![CDATA[My buddy Matt enjoyed what I did with WPLookup and decided to extend it by creating an IRC blog in the WordPress IRC Channel. Check out more about it on Matt&#8217;s blog and check out all of Matt&#8217;s great WordPress plugins he has made available for free.]]></description>
			<content:encoded><![CDATA[<p>My buddy <a href="http://sivel.net" rel="external">Matt</a> enjoyed what I did with WPLookup and decided to extend it by creating an IRC blog in the <a href="http://irc.freenode.net" rel="external">WordPress IRC Channel</a>.</p>
<p>Check out more about it on <a href="http://sivel.net" rel="external">Matt&#8217;s blog</a> and check out all of Matt&#8217;s great <a href="http://sivel.net/category/wordpress/plugins/" rel="external">WordPress plugins</a> he has made available for free.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/wplookup-makes-its-way-to-wordpress-irc-channel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rewinding Posts in WordPress a.k.a. Multiple&#160;Loops</title>
		<link>http://theandystratton.com/2009/rewinding-posts-in-wordpress-aka-multiple-loops</link>
		<comments>http://theandystratton.com/2009/rewinding-posts-in-wordpress-aka-multiple-loops#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:16:05 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://andystratton.com/?p=66</guid>
		<description><![CDATA[So, in my WordPress adventures, there are times I&#8217;ll stray from WordPress&#8217; library of functions for special cases. One of which being when I need to get the ID of the page/post for a random reson, outside the scope of The Loop. The Problem Let&#8217;s say in header.php of my template, I&#8217;m pulling a post: [...]]]></description>
			<content:encoded><![CDATA[<p>So, in my WordPress adventures, there are times I&#8217;ll stray from WordPress&#8217; library of functions for special cases. One of which being when I need to get the <code>ID</code> of the page/post for a random reson, outside the scope of <a href="http://codex.wordpress.org/The_Loop" rel="external">The Loop</a>.</p>
<p><strong>The Problem</strong></p>
<p>Let&#8217;s say in <code>header.php</code> of my template, I&#8217;m pulling a post:</p>
<pre class="brush: php;">if ( have_posts() ) :
	the_post();
	$current_page_id = get_the_ID();
endif;</pre>
<p>This works, but, it increments the cursor of the global <code>$posts</code> array by one. The issue it caused in one of my older projects was that the blog home page (where the array contains 5-10 posts) was never displaying the most recent post.</p>
<p><strong>The Fix &#8211; <code>rewind_posts()</code></strong></p>
<p>Luckily, WordPress has a nifty little function call <a href="http://codex.wordpress.org/Function_Reference/rewind_posts" rel="external"><code>rewind_posts()</code></a> that will&#8230; <em>rewind posts</em>.</p>
<pre class="brush: php;">if ( have_posts() ) :
	the_post();
	$current_page_id = get_the_ID();
	rewind_posts();
endif;</pre>
<p>Using this will throw The Loop back to where it should be.</p>
<p><strong>A better way?</strong></p>
<p>An alternative method of grabbing the ID, san-WordPress functions/tags, would be to grab the ID from the global <code>$posts</code> array. This would save the trouble, but strays from using WP&#8217;s built-in library of functions:</p>
<pre class="brush: php;">global $posts;
$current_page_id = $posts[0]-&gt;ID;</pre>
<p>This works well, and requires fewer lines of code, but I tend to try to stick with the WP functions, as they will aid in keeping your code/plugins/themes future compatible.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/rewinding-posts-in-wordpress-aka-multiple-loops/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WPLookup Features &#8211; Set WPLookup as a browser search&#160;engine</title>
		<link>http://theandystratton.com/2009/new-wplookup-features-set-browser-search</link>
		<comments>http://theandystratton.com/2009/new-wplookup-features-set-browser-search#comments</comments>
		<pubDate>Wed, 18 Feb 2009 01:04:31 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[free stuff]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.andystratton.com/?p=50</guid>
		<description><![CDATA[A few quick updates to WPLookup&#8217;s functionality: WPLookup now accepts the function parameter in a get or post request, allowing some fun browser plugins and the ability to direct link to queries if you so desire. Instead of a notice and link to the function reference when documentation is not found, WPLookup will send you [...]]]></description>
			<content:encoded><![CDATA[<p>A few quick updates to WPLookup&#8217;s functionality:</p>
<ul>
<li>WPLookup now accepts the <code>function</code> parameter in a <code>get</code> or <code>post</code> request, allowing some <a href="#custom-search">fun browser plugins</a> and the ability to <a href="http://wplookup.com/?function=get_pages" rel="external">direct link</a> to queries if you so desire.</li>
<li>Instead of a notice and link to the function reference when documentation is not found, WPLookup will send you to the documentation search results for your query. This makes WPLookup both get you to documentation and search the Codex itself. <em>Note: WPLookup will exchange spaces for your underscores in this scenario to create real search terms.</em></li>
</ul>
<h3 id="custom-search">Adding a custom search engine to Firefox and Opera</h3>
<p>Thanks to @<a href="https://twitter.com/aaronwaggs" rel="external">aaronwaggs</a> for the idea to create a custom search engine for <a href="http://wplookup.com" rel="external">WPLookup</a>.</p>
<p>Here&#8217;s how <em>you</em> can <a href="http://wplookup.com/add-to-browser" rel="external">add WPLookup to your web browser&#8217;s search toolbar</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://theandystratton.com/2009/new-wplookup-features-set-browser-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
