<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress Hacks &#187; Recent Comments</title>
	<atom:link href="http://wphacks.com/tag/recent-comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://wphacks.com</link>
	<description>WordPress Themes, Plugins, Hacks, Tutorials, and more!</description>
	<lastBuildDate>Fri, 25 May 2012 20:07:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Code: Adding Recent Comments To Your WordPress Theme</title>
		<link>http://wphacks.com/wordpress-code-recent-comments/</link>
		<comments>http://wphacks.com/wordpress-code-recent-comments/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 09:00:43 +0000</pubDate>
		<dc:creator>Kyle Eslick</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Recent Comments]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Code]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://wphacks.com/wordpress-code-recent-comments/</guid>
		<description><![CDATA[By default, most WordPress themes display Recent Comments in some form or another. Unfortunately, it isn&#8217;t usually very user-friendly, so it will often get removed. Until now, most of your other options required the use of a WordPress plugin, but today I ran across a great code snippet you can use to display recent comments [...]]]></description>
			<content:encoded><![CDATA[<p>By default, most WordPress themes display Recent Comments in some form or another. Unfortunately, it isn&#8217;t usually very user-friendly, so it will often get removed.</p>
<p>Until now, most of your other options required the use of a WordPress plugin, but today I ran across a great code snippet you can use to display recent comments in a useful format. I just tested it out on my test site and it looks good. Here is the code you will want to paste into your theme&#8217;s sidebar:</p>
<p><code>&lt;h2&gt;Recent Comments&lt;/h2&gt;<br />
&lt;?php<br />
global $wpdb;<br />
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,<br />
comment_post_ID, comment_author, comment_date_gmt, comment_approved,<br />
comment_type,comment_author_url,<br />
SUBSTRING(comment_content,1,30) AS com_excerpt<br />
FROM $wpdb-&gt;comments<br />
LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID =<br />
$wpdb-&gt;posts.ID)<br />
WHERE comment_approved = '1' AND comment_type = '' AND<br />
post_password = ''<br />
ORDER BY comment_date_gmt DESC<br />
LIMIT 10";<br />
$comments = $wpdb-&gt;get_results($sql);<br />
$output = $pre_HTML;<br />
$output .= "\n&lt;ul&gt;";<br />
foreach ($comments as $comment) {<br />
$output .= "\n&lt;li&gt;".strip_tags($comment-&gt;comment_author)<br />
.":" . "&lt;a href=\"" . get_permalink($comment-&gt;ID) .<br />
"#comment-" . $comment-&gt;comment_ID . "\" title=\"on " .<br />
$comment-&gt;post_title . "\"&gt;" . strip_tags($comment-&gt;com_excerpt)<br />
."&lt;/a&gt;&lt;/li&gt;";<br />
}<br />
$output .= "\n&lt;/ul&gt;";<br />
$output .= $post_HTML;<br />
echo $output;?&gt;</code></p>
<p>[<a href="http://wordpressgarage.com/code-snippets/recent-comments-code-snippet/">via WordPress Garage</a>]</p>
<img src="http://wphacks.com/?ak_action=api_record_view&id=82&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://wphacks.com/wordpress-code-recent-comments/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
	</channel>
</rss>

