<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Code Next Door</title>
	
	<link>http://www.codenextdoor.com</link>
	<description>Every great web design deserves great code</description>
	<lastBuildDate>Sat, 09 Jan 2010 14:00:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeNextDoor" /><feedburner:info uri="codenextdoor" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>CodeNextDoor</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Showing Off Your Popular Posts</title>
		<link>http://feedproxy.google.com/~r/CodeNextDoor/~3/uZpT3z0Zxl4/</link>
		<comments>http://www.codenextdoor.com/2010/tips/showing-off-your-popular-posts-in-wordpress/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:00:54 +0000</pubDate>
		<dc:creator>Sels</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.codenextdoor.com/?p=195</guid>
		<description><![CDATA[Alex Denning over at WPSHOUT posted a nice tip for displaying popular posts without the need for a plugin. You can now order posts using the comment_count parameter in WordPress 2.9. He offered a couple different examples and the last one included adding an image along with the post. Well<a href="http://www.codenextdoor.com/2010/tips/showing-off-your-popular-posts-in-wordpress/" rel="nofollow"> Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>Alex Denning over at <a title="WPSHOUT" href="http://wpshout.com/most-commented-posts-the-right-way-in-wordpress/">WPSHOUT</a> posted a nice tip for displaying popular posts without the need for a plugin. You can now order posts using the <em>comment_count</em> parameter in WordPress 2.9. He offered a couple different examples and the last one included adding an image along with the post. Well the latest version of WordPress not only lets you order posts by comment count but also includes the very handy <em>the_post_thumbnail()</em> function. We can use that instead of pulling the image from a custom field.<div class="tweetmeme"><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></p>
<h3>So how is it done?</h3>
<p>First the feature needs to be turned on by including this line in your theme’s <em>function.php</em>:</p>
<pre class="brush: php; auto-links: false; collapse: false; first-line: 1; gutter: false; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">add_theme_support('post-thumbnails');</pre>
<p>Once that is added you can use <em>the_post_thumbnail</em> function in your theme. To accomplish what we’re going after we set up a new query to show the top five posts ordered by comment:</p>
<pre class="brush: php; auto-links: false; collapse: false; first-line: 1; gutter: false; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;?php $popular = new WP_Query('orderedby=comment_count&amp;posts_per_page=5'); ?&gt;
	&lt;?php while ($popular-&gt;have_posts()) : $popular-&gt;the_post(); ?&gt;</pre>
<p>Next we check to see if there is a thumbnail image and if there isn’t we display an alternate image instead:</p>
<pre class="brush: php; auto-links: false; collapse: false; first-line: 1; gutter: false; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;?php if ( has_post_thumbnail() )
		the_post_thumbnail(array(60,60));
	else echo '&lt;img src="default.png" alt="Default Image" title="Default" /&gt;';
	?&gt;</pre>
<p>And finally we add the permalink for the post and close out the query:</p>
<pre class="brush: php; auto-links: false; collapse: false; first-line: 1; gutter: false; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;a href="&lt;?php the_permalink(); ?&gt;" rel="Bookmark" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
&lt;?php endwhile; ?&gt;</pre>
<p>You can also adapt this so it outputs an unordered list. <strong>Note:</strong> This is only going to work in versions 2.9 and up in WordPress. You can add backwards compatibility for <em>the_post_thumbnail</em> function but <em>orderedby=comment_count</em> only works in 2.9.</p>
<p>Here’s the entire query:</p>
<pre class="brush: php; auto-links: false; collapse: false; first-line: 1; gutter: false; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">&lt;?php $popular = new WP_Query('orderedby=comment_count&amp;posts_per_page=5'); ?&gt;
	&lt;?php while ($popular-&gt;have_posts()) : $popular-&gt;the_post(); ?&gt;
	&lt;?php if ( has_post_thumbnail() )
		the_post_thumbnail(array(60,60));
	else echo '&lt;img src="default.png" alt="Default Image" title="Default" /&gt;';
	?&gt;
	&lt;a href="&lt;?php the_permalink(); ?&gt;" rel="Bookmark" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
&lt;?php endwhile; ?&gt;</pre>
<p>Check out the posts over at <a title="Kremalicious - Post Thumbnails" href="http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/">Kremalicious</a> and <a title="WPEngineer - Ultimate Guide fot The Post Thumbnail" href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/">WPEngineer</a> for a lot more information on <em>the_post_thumbnail</em> function. And thanks to Alex Denning at <a title="WPSHOUT" href="http://wpshout.com/most-commented-posts-the-right-way-in-wordpress/">WPSHOUT</a> for the idea.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=uZpT3z0Zxl4:EYMM-V7gMYA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=uZpT3z0Zxl4:EYMM-V7gMYA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=uZpT3z0Zxl4:EYMM-V7gMYA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=uZpT3z0Zxl4:EYMM-V7gMYA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=uZpT3z0Zxl4:EYMM-V7gMYA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=uZpT3z0Zxl4:EYMM-V7gMYA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=uZpT3z0Zxl4:EYMM-V7gMYA:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeNextDoor/~4/uZpT3z0Zxl4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codenextdoor.com/2010/tips/showing-off-your-popular-posts-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codenextdoor.com/2010/tips/showing-off-your-popular-posts-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>Welcome to CodeNextDoor</title>
		<link>http://feedproxy.google.com/~r/CodeNextDoor/~3/37k6ru7w5m8/</link>
		<comments>http://www.codenextdoor.com/2010/updates/welcome-to-codenextdoor/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 17:22:52 +0000</pubDate>
		<dc:creator>Sels</dc:creator>
				<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://www.codenextdoor.com/?p=190</guid>
		<description><![CDATA[I love to code – I remember digging through my mom’s BASIC and Pascal textbooks when I was a kid (wow I feel old) – so suffice it to say I’ve been doing it for a while. I love WordPress and I’m not alone on that one, I have been<a href="http://www.codenextdoor.com/2010/updates/welcome-to-codenextdoor/" rel="nofollow"> Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>I love to code – I remember digging through my mom’s BASIC and Pascal textbooks when I was a kid (wow I feel old) – so suffice it to say I’ve been doing it for a while. I love WordPress and I’m not alone on that one, I have been using WordPress ever since 1.5 came out. And I love to help people.</p>
<h3>Code + WordPress + Helping Others = CodeNextDoor</h3>
<p>I had been racking my brain trying to figure out how to put the concept of CodeNextDoor into words. It hit me after helping someone with a failed WordPress install – the aha moment – using my talents to help others bring their visions to life. That’s what I do and that’s what this site and blog is all about.</p>
<h3>What can you expect?</h3>
<p>There will be new posts 2-3 times a week – helpful tips, resources, tutorials, theme releases and more. This is my gift back to the WordPress community. I wouldn’t know as much as I do now if it weren’t for all of the help I’ve received over the years. I’m just getting my feet wet so go ahead and <a title="Subscribe by RSS" href="http://feeds.feedburner.com/CodeNextDoor">subscribe</a> to stay updated or follow me on <a title="Follow CodeNextDoor on Twitter" href="http://www.twitter.com/codenextdoor">twitter</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=37k6ru7w5m8:xBXHK83q-1g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=37k6ru7w5m8:xBXHK83q-1g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=37k6ru7w5m8:xBXHK83q-1g:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=37k6ru7w5m8:xBXHK83q-1g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=37k6ru7w5m8:xBXHK83q-1g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CodeNextDoor?a=37k6ru7w5m8:xBXHK83q-1g:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CodeNextDoor?i=37k6ru7w5m8:xBXHK83q-1g:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CodeNextDoor/~4/37k6ru7w5m8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codenextdoor.com/2010/updates/welcome-to-codenextdoor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codenextdoor.com/2010/updates/welcome-to-codenextdoor/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
