<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: WordPress &#8211; List your most popular Posts</title>
	<atom:link href="http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/</link>
	<description>Application Developer/Designer</description>
	<lastBuildDate>Tue, 31 Aug 2010 01:39:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Richard</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-76</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sat, 04 Jul 2009 16:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-76</guid>
		<description>Hey David,
Thanks for your comments! You can definitely add more content. You just need to change the SQL Query. For example, the query below will pull the content for the post as well!
[php]
$result = $wpdb-&gt;get_results(&quot;SELECT comment_count, ID, post_title, post_content FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 5&quot;);
[/php]</description>
		<content:encoded><![CDATA[<p>Hey David,</p>
<p>Thanks for your comments! You can definitely add more content. You just need to change the SQL Query. For example, the query below will pull the content for the post as well!</p>
<pre class="brush: php;">
$result = $wpdb-&gt;get_results("SELECT comment_count, ID, post_title, post_content FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 5");
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: david knight</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-65</link>
		<dc:creator>david knight</dc:creator>
		<pubDate>Mon, 29 Jun 2009 20:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-65</guid>
		<description>hi Richard
Great code, thanks for that. One question if thats ok. How would you add more details to the list? Id love to be able to add more of the content, perhaps even categories. Is this possible? Thanks again for the code!</description>
		<content:encoded><![CDATA[<p>hi Richard<br />
Great code, thanks for that. One question if thats ok. How would you add more details to the list? Id love to be able to add more of the content, perhaps even categories. Is this possible? Thanks again for the code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-63</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 28 Jun 2009 22:58:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-63</guid>
		<description>Hello Chaz,
You are correct in stating that it queries the whole database. If you wanted to limit so that it queries a specified date range, that&#039;s possible as well. Cheers!</description>
		<content:encoded><![CDATA[<p>Hello Chaz,</p>
<p>You are correct in stating that it queries the whole database. If you wanted to limit so that it queries a specified date range, that&#8217;s possible as well. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-62</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 28 Jun 2009 22:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-62</guid>
		<description>Hello Chaz,
This works on the home/main page as well.</description>
		<content:encoded><![CDATA[<p>Hello Chaz,</p>
<p>This works on the home/main page as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chaz</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-54</link>
		<dc:creator>chaz</dc:creator>
		<pubDate>Tue, 23 Jun 2009 02:12:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-54</guid>
		<description>What if you want to display them on the main page in the loop instead of the sidebar? It seems as though this only works in the disbar.</description>
		<content:encoded><![CDATA[<p>What if you want to display them on the main page in the loop instead of the sidebar? It seems as though this only works in the disbar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chaz</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-52</link>
		<dc:creator>chaz</dc:creator>
		<pubDate>Sun, 21 Jun 2009 18:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-52</guid>
		<description>It seems as though that if you had a lot of posts that your script would have to query the whole DB to find just the top 5 most actively discussed.
1. Wouldnt it be better to change the query to limit to the last 60 days so that not only would you only have the more relevant articles but also so you dont have to query the whole DB? Or would you still have to query the db anyway?
2. Ideally, it would be nice to set this up to rebuild as a cron job once per day and just include what is built by the daily job... no? Do wordpress offer anything like that? For instance, why build the category list every single time the page is hit when mine hasn&#039;t changed in the last 6 months.</description>
		<content:encoded><![CDATA[<p>It seems as though that if you had a lot of posts that your script would have to query the whole DB to find just the top 5 most actively discussed.</p>
<p>1. Wouldnt it be better to change the query to limit to the last 60 days so that not only would you only have the more relevant articles but also so you dont have to query the whole DB? Or would you still have to query the db anyway?</p>
<p>2. Ideally, it would be nice to set this up to rebuild as a cron job once per day and just include what is built by the daily job&#8230; no? Do wordpress offer anything like that? For instance, why build the category list every single time the page is hit when mine hasn&#8217;t changed in the last 6 months.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-26</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 19 May 2009 23:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-26</guid>
		<description>Hello Loren,
You can easily change the number listed by changing the value in the SQL Statement. So, below where it says &quot;LIMIT 0 , 5&quot; at the end of the statement, you would change 5 to the number desired. :)
[php]
$result = $wpdb-&gt;get_results(&quot;SELECT comment_count, ID, post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 5&quot;);
[/php]</description>
		<content:encoded><![CDATA[<p>Hello Loren,</p>
<p>You can easily change the number listed by changing the value in the SQL Statement. So, below where it says &#8220;LIMIT 0 , 5&#8243; at the end of the statement, you would change 5 to the number desired. <img src='http://www.richardcastera.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: php;">
$result = $wpdb-&gt;get_results(&quot;SELECT comment_count, ID, post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 5&quot;);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-24</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 19 May 2009 19:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-24</guid>
		<description>This works well.  How would you limit the output to the 5 or 10 most commented?</description>
		<content:encoded><![CDATA[<p>This works well.  How would you limit the output to the 5 or 10 most commented?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory Lankin</title>
		<link>http://www.richardcastera.com/2009/05/15/wordpress-list-your-most-popular-posts/#comment-22</link>
		<dc:creator>Cory Lankin</dc:creator>
		<pubDate>Sun, 17 May 2009 21:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.richardcastera.com/?p=220#comment-22</guid>
		<description>Awesome post :)</description>
		<content:encoded><![CDATA[<p>Awesome post <img src='http://www.richardcastera.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.313 seconds -->
