<?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>&#60;SourceBench/&#62; Your place to share code stuff &#187; top posts</title>
	<atom:link href="http://sourcebench.com/tag/top-posts/feed/" rel="self" type="application/rss+xml" />
	<link>http://sourcebench.com</link>
	<description></description>
	<lastBuildDate>Tue, 04 May 2010 07:57:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Display posts by the TAG usage. Most used tags and their posts go first</title>
		<link>http://sourcebench.com/languages/wordpress/display-posts-by-the-tag-usage-most-used-tags-and-their-posts-go-first/</link>
		<comments>http://sourcebench.com/languages/wordpress/display-posts-by-the-tag-usage-most-used-tags-and-their-posts-go-first/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 23:13:34 +0000</pubDate>
		<dc:creator>The SourceBench</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[tag usage]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[top posts]]></category>

		<guid isPermaLink="false">http://sourcebench.com/languages/wordpress/display-posts-by-the-tag-usage-most-used-tags-and-their-posts-go-first/</guid>
		<description><![CDATA[&#60;?php
/*
 * Display posts order by the frequency a tag is used.
 * Most used tags first with the posts in it.
 * Found at http://www.devlounge.net/code/wordpress-snippet-display-posts-by-tag-frequency
 */
  $noOfTags = 10;
  $noOfPosts = 4;
  $cloudRight = get_tags(&#34;orderby=count&#38;order=DESC&#38;number=$noOfTags&#34;);
  foreach((array)$cloudRight as $tagRight) : ?&#62;
	  &#60;?php
	  $postsRight = new WP_Query();
	  $postsRight-&#62;query(&#34;tag={$tagRight-&#62;slug}&#38;showposts=$noOfPosts&#34;);
	  [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">&lt;?php
/*
 * Display posts order by the frequency a tag is used.
 * Most used tags first with the posts in it.
 * Found at <a href="http://www.devlounge.net/code/wordpress-snippet-display-posts-by-tag-frequency" rel="nofollow">http://www.devlounge.net/code/wordpress-snippet-display-posts-by-tag-frequency</a>
 */
  $noOfTags = 10;
  $noOfPosts = 4;
  $cloudRight = get_tags(&quot;orderby=count&amp;order=DESC&amp;number=$noOfTags&quot;);
  foreach((array)$cloudRight as $tagRight) : ?&gt;
	  &lt;?php
	  $postsRight = new WP_Query();
	  $postsRight-&gt;query(&quot;tag={$tagRight-&gt;slug}&amp;showposts=$noOfPosts&quot;);
	  ?&gt;
	  &lt;?php if ( $postsRight-&gt;have_posts() ) <img src='http://sourcebench.com/wp-includes/images/smilies/icon_confused.gif' alt=':?' class='wp-smiley' /> &gt;
		&lt;dl class=&quot;xoxo&quot;&gt;
		  &lt;dt&gt;&lt;?php echo $tagRight-&gt;name ?&gt;&lt;/dt&gt;
		  &lt;?php while ( $postsRight-&gt;have_posts() ) : $postsRight-&gt;the_post(); ?&gt;
		  &lt;dd&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/dd&gt;
		  &lt;?php endwhile;?&gt;
		&lt;/dl&gt;
	  &lt;?php endif; ?&gt;
  &lt;?php
	unset($postsRight);
  endforeach;
?&gt;</pre>]]></content:encoded>
			<wfw:commentRss>http://sourcebench.com/languages/wordpress/display-posts-by-the-tag-usage-most-used-tags-and-their-posts-go-first/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A really simple way to show top posts determined by comment count</title>
		<link>http://sourcebench.com/languages/wordpress/a-really-simple-way-to-show-top-posts-determined-by-comment-count/</link>
		<comments>http://sourcebench.com/languages/wordpress/a-really-simple-way-to-show-top-posts-determined-by-comment-count/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 23:05:52 +0000</pubDate>
		<dc:creator>The SourceBench</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[top posts]]></category>

		<guid isPermaLink="false">http://sourcebench.com/languages/wordpress/a-really-simple-way-to-show-top-posts-determined-by-comment-count/</guid>
		<description><![CDATA[&#60;?php
// a simple way to get most popular posts by comment count, just throw it in your templatefile and alter t your needs
$max = 10; // amount of posts to get
?&#62;
&#60;ul&#62;
&#60;?php
$result = $wpdb-&#62;get_results( $wpdb-&#62;prepare( &#34;SELECT comment_count,ID,post_title FROM $wpdb-&#62;posts ORDER BY comment_count DESC LIMIT 0, %d&#34;, $max ) );
foreach ($result as $post) :
	setup_postdata($post);
	$postid = $post-&#62;ID;
	$title = [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">&lt;?php
// a simple way to get most popular posts by comment count, just throw it in your templatefile and alter t your needs
$max = 10; // amount of posts to get
?&gt;
&lt;ul&gt;
&lt;?php
$result = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT comment_count,ID,post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0, %d&quot;, $max ) );
foreach ($result as $post) :
	setup_postdata($post);
	$postid = $post-&gt;ID;
	$title = $post-&gt;post_title;
	$commentcount = $post-&gt;comment_count;
	if ($commentcount != 0) :
?&gt;
		&lt;li&gt;
			&lt;a href=&quot;&lt;?php echo get_permalink($postid); ?&gt;&quot; title=&quot;&lt;?php echo $title ?&gt;&quot;&gt; &lt;?php echo $title ?&gt;&lt;/a&gt; (&lt;?php echo $commentcount ?&gt;)
		&lt;/li&gt;
&lt;?php
	endif;
endforeach;
?&gt;
&lt;/ul&gt;</pre>]]></content:encoded>
			<wfw:commentRss>http://sourcebench.com/languages/wordpress/a-really-simple-way-to-show-top-posts-determined-by-comment-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
