<?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>The Webmaster's Blog &#187; recent comments</title>
	<atom:link href="http://webmasters-blog.com/tag/recent-comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://webmasters-blog.com</link>
	<description>A complete guide for making more money online through your sites.</description>
	<lastBuildDate>Sat, 03 Jul 2010 05:02:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Show recent comments in your WordPress Blog.</title>
		<link>http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/</link>
		<comments>http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:51:36 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[recent comments]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=291</guid>
		<description><![CDATA[Displaying recent comments on your blog, lets your visitors know about the recent comments on your blog and also encourages them to make comments. Though &#8220;Recent Comments&#8221; does not come as a default widget with WordPress, there are many plugins available for this functions. But if you don&#8217;t want to install anymore plugins, then here [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-294" title="show-recent-comments1" src="http://webmasters-blog.com/wp-content/uploads/2009/04/show-recent-comments1.jpg" alt="show-recent-comments1" width="450" height="378" /></p>
<p>Displaying recent comments on your blog, lets your visitors know about the recent comments on your blog and also encourages them to make comments.</p>
<p>Though &#8220;Recent Comments&#8221; does not come as a default widget with WordPress, there are many plugins available for this functions. But if you don&#8217;t want to install anymore plugins, then here is the simple code snippet for you.</p>
<blockquote><p>&lt;?php<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,comment_author_url, SUBSTRING(comment_content,1,30) 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 <span style="color: #ff0000;">DESC LIMIT 10</span>&#8220;;</p>
<p>$comments = $wpdb-&gt;get_results($sql);<br />
$output = $pre_HTML;<br />
$output .= &#8220;\n&lt;ul&gt;&#8221;;<br />
foreach ($comments as $comment) {<br />
$output .= &#8220;\n&lt;li&gt;&#8221;.strip_tags($comment-&gt;comment_author) .&#8221;:&#8221; . &#8220;&lt;a href=\&#8221;" . get_permalink($comment-&gt;ID).&#8221;#comment-&#8221; . $comment-&gt;comment_ID . &#8220;\&#8221; title=\&#8221;on &#8220;.$comment-&gt;post_title . &#8220;\&#8221;&gt;&#8221; . strip_tags($comment-&gt;com_excerpt).&#8221;&lt;/a&gt;&lt;/li&gt;&#8221;;<br />
}<br />
$output .= &#8220;\n&lt;/ul&gt;&#8221;;<br />
$output .= $post_HTML;<br />
echo $output;<br />
?&gt;</p></blockquote>
<p>Just place this code, wherever you want to show recent comments, may be your sidebar.</p>
<p>This code will list the 10 most recent comments. If you want to list more or less comments, simply change the &#8220;10&#8243; in the $sql variable highlighted in red.</p>
<p>Thats it you are done.</p>

	Tags: <a href="http://webmasters-blog.com/tag/how-to-wordpress/" title="How to" rel="tag nofollow">How to</a>, <a href="http://webmasters-blog.com/tag/recent-comments/" title="recent comments" rel="tag nofollow">recent comments</a>, <a href="http://webmasters-blog.com/tag/wordpress/" title="Wordpress" rel="tag nofollow">Wordpress</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://webmasters-blog.com/howto-reset-your-wordpress-admin-password-manually/" title="Reset your WordPress Admin Password manually. (April 16, 2009)">Reset your WordPress Admin Password manually.</a> (0)</li>
	<li><a href="http://webmasters-blog.com/how-to-add-favicon-to-wordpress/" title="How to add Favicon to WordPress? (April 3, 2009)">How to add Favicon to WordPress?</a> (1)</li>
	<li><a href="http://webmasters-blog.com/howto-display-related-posts-withwithout-plugin-wordpress/" title="Display &#8220;Related Posts&#8221; with/without plugin. (April 16, 2009)">Display &#8220;Related Posts&#8221; with/without plugin.</a> (3)</li>
	<li><a href="http://webmasters-blog.com/howto-display-most-popular-posts-on-sidebar-wordpress/" title="Display &#8220;Most Popular&#8221; posts on sidebar. (April 16, 2009)">Display &#8220;Most Popular&#8221; posts on sidebar.</a> (0)</li>
	<li><a href="http://webmasters-blog.com/howto-create-magazine-style-horizontal-drop-down-menu-for-wordpress-categories-pages/" title="Create horizontal drop-down menu for WordPress Categories/Pages (April 15, 2009)">Create horizontal drop-down menu for WordPress Categories/Pages</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
