<?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>boolean.co.nz &#187; WordPress</title>
	<atom:link href="http://boolean.co.nz/blog/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://boolean.co.nz/blog</link>
	<description>Where there is more to logic than TRUE or FALSE</description>
	<lastBuildDate>Fri, 18 May 2012 09:56:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Adding copyright meta data to WordPress</title>
		<link>http://boolean.co.nz/blog/adding-copyright-meta-data-to-wordpress/692/</link>
		<comments>http://boolean.co.nz/blog/adding-copyright-meta-data-to-wordpress/692/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 01:36:25 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=692</guid>
		<description><![CDATA[This simple example illustrates how easy it is to automatically have copyright information displayed in a sites meta tags. Simply place the following snippet in your functions.php file (remembering of course to substitute your own copyright details add_action(&#8220;wp_head&#8221;, &#8220;add_copyright_meta&#8221;); function add_copyright_meta() { if(is_singular()){ echo &#8220;&#60;meta name=&#8221;copyright&#8221; content=&#8221;Company Details, Year&#8221;&#62;&#8221;; } }]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td><img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>This simple example illustrates how easy it is to automatically have copyright information displayed in a sites meta tags. Simply place the following snippet in your functions.php file (remembering of course to substitute your own copyright details</p>
<div class="codesnip-container" >add_action(&#8220;wp_head&#8221;, &#8220;add_copyright_meta&#8221;);</p>
<p>function add_copyright_meta() {<br />
   if(is_singular()){<br />
      echo &#8220;&lt;meta name=&#8221;copyright&#8221; content=&#8221;Company Details, Year&#8221;&gt;&#8221;;<br />
   }<br />
}</p></div>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/adding-copyright-meta-data-to-wordpress/692/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing WordPress comment spam using .htaccess</title>
		<link>http://boolean.co.nz/blog/reducing-wordpress-comment-spam-using-htaccess/599/</link>
		<comments>http://boolean.co.nz/blog/reducing-wordpress-comment-spam-using-htaccess/599/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 09:13:22 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=599</guid>
		<description><![CDATA[I haven&#8217;t actually tried this, but the thought has occurred to me that a great way to reduce comment spam would be to use the following in your .htaccess file: &#60;IfModule mod_rewrite.c&#62; RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post\.php* RewriteCond %{HTTP_REFERER} !.*blogdomainname.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L] &#60;/IfModule&#62; Obviously you&#8217;ll need [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>I haven&#8217;t actually tried this, but the thought has occurred to me that a great way to reduce comment spam would be to use the following in your .htaccess file:</p>
<div class="codesnip-container" >&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_METHOD} POST<br />
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*<br />
RewriteCond %{HTTP_REFERER} !.*blogdomainname.* [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^$<br />
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]<br />
&lt;/IfModule&gt;</div>
<p>Obviously you&#8217;ll need to change blogdomainname to your own domain</p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/reducing-wordpress-comment-spam-using-htaccess/599/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress site URL during staging</title>
		<link>http://boolean.co.nz/blog/wordpress-site-url-during-staging/569/</link>
		<comments>http://boolean.co.nz/blog/wordpress-site-url-during-staging/569/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 10:03:51 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=569</guid>
		<description><![CDATA[It is often useful to have a development and a staging environment alongside a production WordPress installation. Whilst staging it can be also be helpful to hook into the regular production database prior to switching the site live just to make sure there are no suprises ahead. Because WordPress defines the site URL used for [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td><img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>It is often useful to have a development and a staging environment alongside a production WordPress installation. Whilst staging it can be also be helpful to hook into the regular production database prior to switching the site live just to make sure there are no suprises ahead.<br />
Because WordPress defines the site URL used for generating all links from a database entry, placing the below declarations into your wp-config.php file can quickly allow you to do this (without having to use a preview theme) Obviously replace staginurl with your own address!</p>
<div class="codesnip-container" >define(&#8216;WP_HOME&#8217;,'http://stagingurl.com&#8217;);<br />
define(&#8216;WP_SITEURL&#8217;,'http://stagingurl.com&#8217;);</div>
<p>Some background reading in the WordPress codex is <a href="http://codex.wordpress.org/Changing_The_Site_URL">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/wordpress-site-url-during-staging/569/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Hardening</title>
		<link>http://boolean.co.nz/blog/wordpress-hardening/565/</link>
		<comments>http://boolean.co.nz/blog/wordpress-hardening/565/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 05:49:55 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=565</guid>
		<description><![CDATA[After a clients WordPress site was recently comprimised and subsequently serving up malware and spam a few quick reminders for WordPress security hardening: Change the database prefix to something other than wp_ Change the security key salts Protect config file through htaccess Dont use admin or administrator for the default user Use a strong password [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>After a clients WordPress site was recently comprimised and subsequently serving up malware and spam a few quick reminders for WordPress security hardening:</p>
<p>Change the database prefix to something other than wp_<br />
Change the security key salts<br />
Protect config file through htaccess<br />
Dont use admin or administrator for the default user<br />
Use a strong password<br />
CHMOD the uploads folder<br />
CHMOD the config and htaccess to 640<br />
Install and configure Akismet for spam prevention</p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/wordpress-hardening/565/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone WordPress Application Configuration</title>
		<link>http://boolean.co.nz/blog/iphone-wordpress-application-configuration/485/</link>
		<comments>http://boolean.co.nz/blog/iphone-wordpress-application-configuration/485/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 22:50:30 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=485</guid>
		<description><![CDATA[On a self hosted WordPress installation (not a wordpress.com or .org) I was being continually rebuffed by an incorrect username/password combination &#8211; and I knew my password was correct. Was it a problem with the iPhone application itself, was my blog misconfigured, who is John Galt? The solution as it turns out was reasonably simple: [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>On a self hosted WordPress installation (not a wordpress.com or .org) I was being continually rebuffed by an incorrect username/password combination &#8211; and I knew my password was correct.<br />
Was it a problem with the iPhone application itself, was my blog misconfigured,  who is John Galt?</p>
<p>The solution as it turns out was reasonably simple:</p>
<p>From your WordPress installation admin control panel: under Settings -> Writing in the Remote Publishing section ensure there is a tick in the checkbox</p>
<p><strong>XML-RPC &#8211; Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.</strong></p>
<p>After that, you should be able to add the site from the iPhone app.  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/iphone-wordpress-application-configuration/485/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP credentials in WordPress</title>
		<link>http://boolean.co.nz/blog/ftp-credentials-in-wordpress/477/</link>
		<comments>http://boolean.co.nz/blog/ftp-credentials-in-wordpress/477/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 15:03:13 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=477</guid>
		<description><![CDATA[The issue is that when you try to automatically update your WordPress installation you are asked to supply your ftp login credentials. Hopefully just like me you are using unique, complex and hard to remember details. Joost De Valk created a plugin to fix the automatic update issue that some webhosts have here The plugin [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>The issue is that when you try to automatically update your WordPress installation you are asked to supply your ftp login credentials. Hopefully just like me you are using unique, complex and hard to remember details. Joost De Valk created a plugin to fix the automatic update issue that some webhosts have <a href="http://yoast.com/fix-automatic-plugin-update/">here</a></p>
<p>The plugin (and this alternative) are a way to avoid having to go look up the details before plugging them in every time you wish to update.</p>
<p>In your wp-config.php you can define these values to hopefully end this problem once and for all:</p>
<div class="codesnip-container" >define(&#8216;FS_METHOD&#8217;, &#8216;ftpext&#8217;);<br />
define(&#8216;FTP_BASE&#8217;, &#8216;/path/to/wordpress/&#8217;);<br />
define(&#8216;FTP_USER&#8217;, &#8216;username&#8217;);<br />
define(&#8216;FTP_PASS&#8217;, &#8216;password&#8217;);<br />
define(&#8216;FTP_HOST&#8217;, &#8216;host&#8217;);<br />
define(&#8216;FTP_SSL&#8217;, false);</div>
<p>The codex has a little more to say on the matter <a href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/ftp-credentials-in-wordpress/477/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renaming WordPress database prefixes</title>
		<link>http://boolean.co.nz/blog/renaming-wordpress-database-prefixes/471/</link>
		<comments>http://boolean.co.nz/blog/renaming-wordpress-database-prefixes/471/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 18:53:23 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=471</guid>
		<description><![CDATA[Having non-standard table prefixes can help reduce automated attacks and malicious scripts from compromising your WordPresss database This is a fairly simple process if you are familiar with the underlying database and principles, but is not recommended unless you are experienced with queries and a sql client such as phpMyAdmin 1) Prepare by making a [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>Having non-standard table prefixes can help reduce automated attacks and malicious scripts from compromising your WordPresss database</p>
<p>This is a fairly simple process if you are familiar with the underlying database and principles, but is not recommended unless you are experienced with queries and a sql client such as phpMyAdmin</p>
<p><strong>1) Prepare</strong> by making a backup everything, redirect your visitors etc<br />
<strong>2) Change</strong> the default table prefix in wp-config.php to your required name<br />
<strong>3) Rename</strong> all WordPress database table prefixes</p>
<p>Here are the necessary SQL commands (remember to change the example to your own table prefix)</p>
<div class="codesnip-container" >RENAME table &#8216;wp_commentmeta&#8217; TO &#8216;wp_rand0mstr1ng_commentmeta&#8217;;<br />
RENAME table &#8216;wp_comments&#8217; TO &#8216;wp_rand0mstr1ng_comments&#8217;;<br />
RENAME table &#8216;wp_links&#8217; TO &#8216;wp_rand0mstr1ng_links&#8217;;<br />
RENAME table &#8216;wp_options&#8217; TO &#8216;wp_rand0mstr1ng_options&#8217;;<br />
RENAME table &#8216;wp_postmeta&#8217; TO &#8216;wp_rand0mstr1ng_postmeta&#8217;;<br />
RENAME table &#8216;wp_posts&#8217; TO &#8216;wp_rand0mstr1ng_posts&#8217;;<br />
RENAME table &#8216;wp_terms&#8217; TO &#8216;wp_rand0mstr1ng_terms&#8217;;<br />
RENAME table &#8216;wp_term_relationships&#8217; TO &#8216;wp_rand0mstr1ng_term_relationships&#8217;;<br />
RENAME table &#8216;wp_term_taxonomy&#8217; TO &#8216;wp_rand0mstr1ng_term_taxonomy&#8217;;<br />
RENAME table &#8216;wp_usermeta&#8217; TO &#8216;wp_rand0mstr1ng_usermeta&#8217;;<br />
RENAME table &#8216;wp_users&#8217; TO &#8216;wp_rand0mstr1ng_users&#8217;;</div>
<p>Remember if there are other WordPress related tables created by plugins you will need to rename these as well. ALL table prefixes should be renamed.</p>
<p><strong>4) Search</strong> the options table for any instances of the old table prefixes</p>
<div class="codesnip-container" >SELECT * FROM &#8216;wp_rand0mstr1ng_options&#8217; WHERE &#8216;option_name&#8217; LIKE &#8216;%wp_%&#8217;</div>
<p>This will return wp_user_roles and any options or configurations created by plugins or custom scripts. Update the fields as appropriate.</p>
<p><strong>5) Edit</strong> the usermeta table</p>
<p>Search the usermeta for all instances of the old table prefixes</p>
<div class="codesnip-container" >SELECT * FROM &#8216;wp_rand0mstr1ng_usermeta&#8217; WHERE &#8216;meta_key&#8217; LIKE &#8216;%wp_%&#8217;</div>
<p>Again these fields will need to be updated where appropriate</p>
<p>Test everything is working and then set your site to live once again.</p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/renaming-wordpress-database-prefixes/471/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Google Maps in WordPress</title>
		<link>http://boolean.co.nz/blog/embedding-google-maps-in-wordpress/388/</link>
		<comments>http://boolean.co.nz/blog/embedding-google-maps-in-wordpress/388/#comments</comments>
		<pubDate>Sun, 16 May 2010 03:52:43 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=388</guid>
		<description><![CDATA[According to the support on the WordPress site here embedding GoogleMaps in WordPress is simply a matter of cutting and pasting the Iframe to your post. Simple! Effective? Not so much! The problem is that if you use the Visual instead of the HTML Post or Page editors the code can get very messed up [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>According to the support on the WordPress site <a href="http://en.support.wordpress.com/google-maps/">here</a> embedding GoogleMaps in WordPress is simply a matter of cutting and pasting the Iframe to your post. Simple! Effective? Not so much!</p>
<p>The problem is that if you use the Visual instead of the HTML Post or Page editors the code can get very messed up which is frustrating to say the least. So, a simple and elegant solution:</p>
<p>In your functions.php file (for your relevant theme of course) place the following code</p>
<div class="codesnip-container" >//GoogleMaps Shortcode<br />
function googleMaps($attribs, $content = null) {<br />
   extract(shortcode_attribs(array(<br />
      &#8220;width&#8221; =&gt; &#8217;640&#8242;,<br />
      &#8220;height&#8221; =&gt; &#8217;480&#8242;,<br />
      &#8220;src&#8221; =&gt; &#8221;<br />
   ), $attribs));<br />
   return &#8216;&lt;iframe width=&#8221;&#8216;.$width.&#8217;&#8221; height=&#8221;&#8216;.$height.&#8217;&#8221; scrolling=&#8221;no&#8221; frameborder=&#8221;0&#8243; marginwidth=&#8221;0&#8243; marginheight=&#8221;0&#8243;src=&#8221;&#8216;.$src.&#8217;&amp;output=embed&gt;&lt;/iframe&gt;&#8217;;<br />
}<br />
add_shortcode(&#8220;googlemap&#8221;, &#8220;googleMaps&#8221;);</div>
<p><strong>Usage within a Page or Post</strong></p>
<div class="codesnip-container" >[googlemap width="200" height="200" src="[url]&#8220;]</div>
<p>So, three parameters. Width and Height are optional; if you do not specify the size will default to that specified in the functions.php file. The URL is simply the GoogleMaps share URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/embedding-google-maps-in-wordpress/388/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress &#8216;hacks&#8217;</title>
		<link>http://boolean.co.nz/blog/wordpress-hacks/334/</link>
		<comments>http://boolean.co.nz/blog/wordpress-hacks/334/#comments</comments>
		<pubDate>Thu, 06 May 2010 22:53:49 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=334</guid>
		<description><![CDATA[Been doing a bit of WordPress customisation work recently, &#8211; here are a few ways to delve into your content. There are plugins available for a lot of these techniques; however sometimes you may wish to trim your plugins for speed or other considerations. Enjoy. 1) Displaying Related Posts Related posts can retain your readers [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" /></td>
</tr>
</table>
<p>Been doing a bit of WordPress customisation work recently, &#8211; here are a few ways to delve into your content. There are plugins available for a lot of these techniques; however sometimes you may wish to trim your plugins for speed or other considerations. Enjoy.</p>
<p><strong>1) Displaying Related Posts</strong><br />
Related posts can retain your readers by offering them easy to click, context related links. To execute this &#8216;hack&#8217; you will need to edit your single.php file (in your current theme)</p>
<div class="codesnip-container" >&lt;?php<br />
//Place in the loop to list 5 posts related to the first tag in the current post<br />
$tags = wp_get_post_tags($post-&gt;ID);<br />
if ($tags) {<br />
  echo &#8216;Related Posts&#8217;;<br />
  $first_tag = $tags[0]-&gt;term_id;<br />
  $args=array(<br />
    &#8216;tag__in&#8217; =&gt; array($first_tag),<br />
    &#8216;post__not_in&#8217; =&gt; array($post-&gt;ID),<br />
    &#8216;showposts&#8217;=&gt;5,      &#8216;caller_get_posts&#8217;=&gt;1<br />
  );<br />
  $my_query = new WP_Query($args);<br />
  if( $my_query-&gt;have_posts() ) {<br />
    while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;<br />
      &lt;p&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;<br />
    &lt;?php endwhile;<br />
  }<br />
}<br />
?&gt;</div>
<p><strong>2) Displaying Recent Comments</strong><br />
Recent comments can be very helpful to build awareness of what topics readers are finding value in. To display recent comments you will need to modify your functions.php file (in your current theme)<br />
If this file is not present, you will need to create it.</p>
<div class="codesnip-container" >&lt;?php<br />
function recent_comments($src_count=10, $src_length=60, $pre_HTML=&#8217;&lt;ul&gt;&#8217;, $post_HTML=&#8221;) {<br />
global $wpdb;<br />
$sql = &#8220;SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,<br />
SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb-&gt;comments LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID = $wpdb-&gt;posts.ID) WHERE comment_approved = &#8217;1&#8242; AND comment_type = &#8221; AND post_password = &#8221; ORDER BY comment_date_gmt DESC<br />
LIMIT $src_count&#8221;;<br />
$comments = $wpdb-&gt;get_results($sql);<br />
$output = $pre_HTML;<br />
foreach ($comments as $comment) {<br />
$output .= &#8220;&lt;li&gt;&lt;a href=\&#8221;" . get_permalink($comment-&gt;ID) . &#8220;#comment-&#8221; . $comment-&gt;comment_ID . &#8220;\&#8221; title=\&#8221;on &#8221; . $comment-&gt;post_title . &#8220;\&#8221;&gt;&#8221; . strip_tags($comment-&gt;com_excerpt) .&#8221;&#8230;&lt;/a&gt;&lt;/li&gt;&#8221;;<br />
}<br />
$output .= $post_HTML;<br />
echo $output;<br />
}<br />
?&gt;</div>
<p>Wherever you would like to place comments simply include the following line:</p>
<div class="codesnip-container" >&lt;?php recent_comments(); ?&gt;</div>
<p><strong>3) Adding A Print Button To Blog Posts</strong><br />
Of course there are keyboard shortcuts and other ways to perform this task, but it is nice little feature to offer.<br />
Edit your single.php file (in your current theme) and add the following code:</p>
<div class="codesnip-container" >&lt;a href=&#8221;javascript:window.print()&#8221; rel=&#8221;nofollow&#8221;&gt;Print this Article&lt;/a&gt;</div>
<p><strong>4) Excluding Categories From Your RSS Feed</strong><br />
Perhaps your have a category which has little to do with the rest of your blog, &#8211; sometimes it can be useful to exclude certain categories from your feed. Simple.</p>
<p>You will need to know the Category ID (cat_id= seen in your URLs)</p>
<p>Edit your function.php file (for your current theme, or create one if it doesnt exist)</p>
<div class="codesnip-container" >function myFilter($query) {<br />
  if ($query-&gt;is_feed) {<br />
    $query-&gt;set(&#8216;cat&#8217;,'-5&#8242;); //Don&#8217;t forget to change the category ID =^o^=<br />
  }<br />
  return $query;<br />
}</p>
<p>add_filter(&#8216;pre_get_posts&#8217;,'myFilter&#8217;);</p></div>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/wordpress-hacks/334/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Custom RSS feeds</title>
		<link>http://boolean.co.nz/blog/wordpress-custom-rss-feeds/328/</link>
		<comments>http://boolean.co.nz/blog/wordpress-custom-rss-feeds/328/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 02:21:42 +0000</pubDate>
		<dc:creator>Boolean</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://boolean.co.nz/blog/?p=328</guid>
		<description><![CDATA[Adding custom content to your RSS feed is actually a fairly simple process. You may wish to do this to add a copyright notice, a link to social media profile, twitter account, or perhaps even sell advertising. Basic usage looks like this: function rssModification ($contentToFilter) { // Manipulate the content as required return $contentToFilter; }add_filter(&#8216;filterName&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://boolean.co.nz/blog/wp-content/uploads/2009/04/wordpress_logo.png" alt="Wordpress Logo" title="wordpress_logo" width="360" height="82" class="aligncenter size-full wp-image-91" />
</td>
</tr>
</table>
<p>Adding custom content to your RSS feed is actually a fairly simple process. You may wish to do this to add a copyright notice, a link to social media profile, twitter account, or perhaps even sell advertising.<br />
Basic usage looks like this:</p>
<div class="codesnip-container" >function rssModification ($contentToFilter) {<br />
 // Manipulate the content as required<br />
return $contentToFilter;<br />
}add_filter(&#8216;filterName&#8217;, &#8216;rssModification &#8216;);</div>
<p>There are lots of filters available and obviously an extensive list <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">here.</a> In this example we are going to use the <strong>the_excerpt_rss </strong> and <strong>the_content_rss</strong> filters.</p>
<p>When the filter is executed the data to be modified is passed to the specified function. The content can then be altered and then returned.</p>
<div class="codesnip-container" >function rssContent($content) {<br />
	$content = $content . &#8216;&#60;a href=&#8221;http://twitter.com/booleanvalue/&#8221;&#62;Follow me on Twitter!&#60;/a&#62;&#8217;;<br />
	return $content;<br />
}<br />
add_filter(&#8216;the_excerpt_rss&#8217;, &#8216;rssContent&#8217;);<br />
add_filter(&#8216;the_content_rss&#8217;, &#8216;rssContent&#8217;);</div>
]]></content:encoded>
			<wfw:commentRss>http://boolean.co.nz/blog/wordpress-custom-rss-feeds/328/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

