<?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>WP WordPress &#187; coding</title>
	<atom:link href="http://www.wpwordpress.com/tag/coding/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwordpress.com</link>
	<description>Online WordPress Tips, Tutorials, and Resources for WordPress Users</description>
	<lastBuildDate>Thu, 05 Nov 2009 15:48:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>How to Display Most Recent Twitter Tweets in WordPress Blog</title>
		<link>http://www.wpwordpress.com/how-to-display-most-recent-twitter-tweets-in-wordpress-blog</link>
		<comments>http://www.wpwordpress.com/how-to-display-most-recent-twitter-tweets-in-wordpress-blog#comments</comments>
		<pubDate>Fri, 09 Oct 2009 04:03:12 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=270</guid>
		<description><![CDATA[<p>Since Twitter became popular, many bloggers like to display recent twitter tweets on their website... <a href="http://www.wpwordpress.com/how-to-display-most-recent-twitter-tweets-in-wordpress-blog">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-most-recent-twitter-tweets-in-wordpress-blog"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-most-recent-twitter-tweets-in-wordpress-blog&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Since Twitter became popular, many bloggers like to display recent twitter tweets on their website or blog. <strong>To display most recent twitter tweets</strong>, simply copy and paste the following code to your <em>sidebar.php</em> file.</p>
<pre><code>&lt;?php
// Your twitter username.
$username = "TwitterUsername";
// Prefix - some text you want displayed before your latest tweet.
// (HTML is OK, but be sure to escape quotes with backslashes: for example href=\"link.html\")
$prefix = "";
// Suffix - some text you want display after your latest tweet. (Same rules as the prefix.)
$suffix = "";
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&amp;rpp=1";
function parse_feed($feed) {
$stepOne = explode("&lt;content type=\"html\"&gt;", $feed);
$stepTwo = explode("&lt;/content&gt;", $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace(”&amp;lt;”, “&lt;”, $tweet);
$tweet = str_replace(”&amp;gt;”, “&gt;”, $tweet);
return $tweet;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?&gt;</code></pre>
<p>Thanks the awesome code from <a href="http://wphacks.com/huge-compilation-of-wordpress-code">WP Hacks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-display-most-recent-twitter-tweets-in-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create Meta Description Function and Meta Keyword Tags</title>
		<link>http://www.wpwordpress.com/how-to-create-meta-description-function-and-meta-keyword-tags</link>
		<comments>http://www.wpwordpress.com/how-to-create-meta-description-function-and-meta-keyword-tags#comments</comments>
		<pubDate>Mon, 05 Oct 2009 02:55:39 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=247</guid>
		<description><![CDATA[<p>If you want to create meta description function and meta keyword tags for your wordpress themes,... <a href="http://www.wpwordpress.com/how-to-create-meta-description-function-and-meta-keyword-tags">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-create-meta-description-function-and-meta-keyword-tags"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-create-meta-description-function-and-meta-keyword-tags&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you want to <strong>create meta description function and meta keyword tags</strong> for your wordpress themes, open <em>header.php</em> file and then copy and paste the following code within  <em>&lt;head&gt;</em> and <em>&lt;/head&gt;</em>.</p>
<pre><code>&lt;meta name="description" content="
&lt;?php if ( (is_home()) || (is_front_page()) ) {
echo ('Your main description goes here');
} elseif(is_category()) {
echo category_description();
} elseif(is_tag()) {
echo '-tag archive page for this blog' . single_tag_title();
} elseif(is_month()) {
echo 'archive page for this blog' . the_time('F, Y');
} else {
echo get_post_meta($post-&gt;ID, "Metadescription", true);
}?&gt;"&gt;</code></pre>
<p>Thanks the original function from <a href="http://www.malcolmcoles.co.uk/blog/unique-meta-description-and-meta-keywords-in-your-wordpress-themes"></a>Malcolm Coles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-create-meta-description-function-and-meta-keyword-tags/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Display the Total Number of Comments on Your Blog</title>
		<link>http://www.wpwordpress.com/how-to-display-the-total-number-of-comments-on-your-blog</link>
		<comments>http://www.wpwordpress.com/how-to-display-the-total-number-of-comments-on-your-blog#comments</comments>
		<pubDate>Fri, 02 Oct 2009 00:33:14 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=228</guid>
		<description><![CDATA[<p>Who don't like to have comments on your blog? If your blog has many comments, it can be say that... <a href="http://www.wpwordpress.com/how-to-display-the-total-number-of-comments-on-your-blog">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-the-total-number-of-comments-on-your-blog"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-the-total-number-of-comments-on-your-blog&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Who don&#8217;t like to have comments on your blog? If your blog has many comments, it can be say that your blogs is popular, at least people like to interact with you to ask question and share information with you. If you really proud with your total number of comments on your blog, and want to show off to visitors.</p>
<p><strong>To display the total number of comments on your blog</strong>, simple add the following code to your wordpress files.</p>
<pre><code>&lt;?php
$numcomms = $wpdb-&gt;get_var("SELECT COUNT(*) FROM $wpdb-&gt;comments WHERE comment_approved = '1'");
if (0 &lt; $numcomms) $numcomms = number_format($numcomms);
echo "There's ".$numcomms." total comments on my blog";
?&gt;</code></pre>
<p>Special thanks to <a href="http://www.phpmagicbook.com/display-the-total-number-of-comments-on-your-wordpress-blog">PHP Magic Book</a> for this awesome code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-display-the-total-number-of-comments-on-your-blog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create Page Templates</title>
		<link>http://www.wpwordpress.com/how-to-create-page-templates</link>
		<comments>http://www.wpwordpress.com/how-to-create-page-templates#comments</comments>
		<pubDate>Thu, 01 Oct 2009 01:10:50 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=213</guid>
		<description><![CDATA[<p>Normally I will use page templates to display the archives which will list all posts on my blog,... <a href="http://www.wpwordpress.com/how-to-create-page-templates">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-create-page-templates"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-create-page-templates&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Normally I will use page templates to display the archives which will list all posts on my blog, anyway you can use page templates to get specialized results apart from the basic static page template.</p>
<p>What you need to do is to add the following code to the first line of your php files, you can change the template name as you wish.</p>
<pre><code>&lt;?php
/*
Template Name: Archives
*/
?&gt;</pre>
<p></code></p>
<p><img class="alignleft" src="http://www.wpwordpress.com/wp-content/uploads/2009/10/pagetemplates.jpg" border="0" alt="" />So now, you have to create a page template named <strong>Archives</strong>. Then, create a new page, find Template drop down box (refer picture) and choose Archives, this is a page template named Archives that you have created just now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-create-page-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add a Print Button to Your Posts</title>
		<link>http://www.wpwordpress.com/how-to-add-a-print-button-to-your-posts</link>
		<comments>http://www.wpwordpress.com/how-to-add-a-print-button-to-your-posts#comments</comments>
		<pubDate>Wed, 30 Sep 2009 22:35:52 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=209</guid>
		<description><![CDATA[<p>I don't think you will need to add a print button to your posts on your blog, but in case you want... <a href="http://www.wpwordpress.com/how-to-add-a-print-button-to-your-posts">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-add-a-print-button-to-your-posts"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-add-a-print-button-to-your-posts&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I don&#8217;t think you will need to <strong>add a print button to your posts</strong> on your blog, but in case you want to have it, you can just copy and paste the following code into <em>single.php</em> file. It&#8217;s looks simple, right? @_@</p>
<pre><code>&lt;a href="javascript:window.print()"&gt;Print this Article&lt;/a&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-add-a-print-button-to-your-posts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Display Google Adsense After The First Post</title>
		<link>http://www.wpwordpress.com/how-to-display-google-adsense-after-the-first-post</link>
		<comments>http://www.wpwordpress.com/how-to-display-google-adsense-after-the-first-post#comments</comments>
		<pubDate>Wed, 30 Sep 2009 22:03:39 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Advance]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=203</guid>
		<description><![CDATA[<p>If you want to display Google Adsense After the first post, then you can refer to the following... <a href="http://www.wpwordpress.com/how-to-display-google-adsense-after-the-first-post">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-google-adsense-after-the-first-post"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-google-adsense-after-the-first-post&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you want to <strong>display Google Adsense After the first post</strong>, then you can refer to the following code and see how it works. Honestly, this is a wonderful code that I have been looking for so long.</p>
<pre><code>&lt;?php if (have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); $loopcounter++; ?&gt;

// the loop stuffs

&lt;?php if ($loopcounter &lt;= 1) { include (TEMPLATEPATH . '/ad.php'); } ?&gt;

&lt;?php endwhile; ?&gt;
&lt;?php else : ?&gt;
&lt;?php endif; ?&gt;</code></pre>
<p>Thanks <a href="http://www.webdesignerwall.com/tutorials/wordpress-theme-hacks">Web Designer Wall</a> for this awesome code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-display-google-adsense-after-the-first-post/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Display Twitter Count in Plain Text</title>
		<link>http://www.wpwordpress.com/how-to-display-twitter-count-in-plain-text</link>
		<comments>http://www.wpwordpress.com/how-to-display-twitter-count-in-plain-text#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:43:55 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=201</guid>
		<description><![CDATA[<p>Many people will use Twitter counter badge from TwitterCounter.com to show twitter count in their... <a href="http://www.wpwordpress.com/how-to-display-twitter-count-in-plain-text">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-twitter-count-in-plain-text"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-twitter-count-in-plain-text&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Many people will use Twitter counter badge from <a href=http://twittercounter.com>TwitterCounter.com</a> to show twitter count in their website or blog, but twitter counter badges from TwitterCounter.com didn&#8217;t come with color personalization, sometimes it can&#8217;t match the color of the theme, so I don&#8217;t like to use it.</p>
<p>If you want to <strong>display Twitter count in plain text</strong>, you can follow the below steps.</p>
<p>1. Add the following code to functions.php.</p>
<pre><code>function string_getInsertedString($long_string,$short_string,$is_html=false){
  if($short_string&gt;=strlen($long_string))return false;
  $insertion_length=strlen($long_string)-strlen($short_string);
  for($i=0;$i&lt;strlen($short_string);++$i){
    if($long_string[$i]!=$short_string[$i])break;
  }
  $inserted_string=substr($long_string,$i,$insertion_length);
  if($is_html &amp;&amp; $inserted_string[$insertion_length-1]=='&lt;'){
    $inserted_string='&lt;'.substr($inserted_string,0,$insertion_length-1);
  }
  return $inserted_string;
}

function DOMElement_getOuterHTML($document,$element){
  $html=$document-&gt;saveHTML();
  $element-&gt;parentNode-&gt;removeChild($element);
  $html2=$document-&gt;saveHTML();
  return string_getInsertedString($html,$html2,true);
}

function getFollowers($username){
  $x = file_get_contents("http://twitter.com/".$username);
  $doc = new DomDocument;
  @$doc-&gt;loadHTML($x);
  $ele = $doc-&gt;getElementById('follower_count');
  $innerHTML=preg_replace('/^&lt;[^&gt;]*&gt;(.*)&lt;[^&gt;]*&gt;$/',"\\1",DOMElement_getOuterHTML($doc,$ele));
  return $innerHTML;
}</code></pre>
<p>2. Copy and paste the following short code to anywhere on your theme files, remember replace your twitter username.</p>
<pre><code>&lt;?php echo getFollowers("yourtwitterusername")." followers"; ?&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-display-twitter-count-in-plain-text/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Seperate Comments and Trackbacks</title>
		<link>http://www.wpwordpress.com/how-to-seperate-comments-and-trackbacks</link>
		<comments>http://www.wpwordpress.com/how-to-seperate-comments-and-trackbacks#comments</comments>
		<pubDate>Fri, 18 Sep 2009 10:04:05 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Advance]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=170</guid>
		<description><![CDATA[<p>Most wordpress themes combine comments with trackbacks, if you want to separate comments and... <a href="http://www.wpwordpress.com/how-to-seperate-comments-and-trackbacks">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-seperate-comments-and-trackbacks"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-seperate-comments-and-trackbacks&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Most wordpress themes combine comments with trackbacks, if you want to <strong>separate comments and trackbacks</strong> so that it will looks more organized, then you can follow the below step by step guide.</p>
<h3>Step 1</h3>
<p>Open <em>comments.php</em> and look for</p>
<pre><code>&lt;?php foreach ($comments as $comment) : ?&gt;</code></pre>
<p>Paste after</p>
<pre><code>&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type == 'comment') { ?&gt;</code></pre>
<h3>Step 2</h3>
<p>Scroll down a bit and look for</p>
<pre><code>&lt;?php endforeach; /* end for each comment */ ?&gt;</code></pre>
<p>Paste before</p>
<pre><code>&lt;?php } else { $trackback = true; } /* End of is_comment statement */ ?&gt;</code></pre>
<h3>Step 3</h3>
<p>Look for</p>
<pre><code>&lt;?php else : // this is displayed if there are no comments so far ?&gt;</code></pre>
<p>Paste before</p>
<pre><code>&lt;?php if ($trackback == true) { ?&gt;
&lt;h3&gt;Trackbacks&lt;/h3&gt;
&lt;ol&gt;
&lt;?php foreach ($comments as $comment) : ?&gt;
&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type != 'comment') { ?&gt;
&lt;li&gt;&lt;?php comment_author_link() ?&gt;&lt;/li&gt;
&lt;?php } ?&gt;
&lt;?php endforeach; ?&gt;
&lt;/ol&gt;
&lt;?php } ?&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-seperate-comments-and-trackbacks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Display Categories in Drop-Down Box</title>
		<link>http://www.wpwordpress.com/how-to-display-categories-in-drop-down-box</link>
		<comments>http://www.wpwordpress.com/how-to-display-categories-in-drop-down-box#comments</comments>
		<pubDate>Fri, 18 Sep 2009 07:37:00 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=164</guid>
		<description><![CDATA[<p>Personally, I prefer to display my blog categories without in drop down box, but if you really have... <a href="http://www.wpwordpress.com/how-to-display-categories-in-drop-down-box">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-categories-in-drop-down-box"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-display-categories-in-drop-down-box&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Personally, I prefer to display my blog categories without in drop down box, but if you really have many categories on your blog, perhaps you can <strong>display categories in drop-down box</strong> so that your blog will looks more neat.</p>
<p>Below is the simple code to display categories:-</p>
<pre><code>&lt;h2&gt;Categories&lt;/h2&gt;
&lt;ul&gt;
&lt;?php wp_list_cats('sort_column=name'); ?&gt;
&lt;/ul&gt;</code></pre>
<p>To display categories in drop-down box, use the following code.</p>
<pre><code>&lt;form action="&lt;?php bloginfo('url'); ?&gt;/" method="get"&gt;
&lt;?php
$select = wp_dropdown_categories('show_option_none=Select category&amp;show_count=1&amp;orderby=name&amp;echo=0');
$select = preg_replace("#&lt;select([^&gt;]*)&gt;#", "&lt;select$1 onchange='return this.form.submit()'&gt;", $select); echo $select; ?&gt;
&lt;noscript&gt;&lt;input type="submit" value="View" /&gt;&lt;/noscript&gt;
&lt;/form&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-display-categories-in-drop-down-box/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Exclude Certain Categories</title>
		<link>http://www.wpwordpress.com/how-to-exclude-certain-categories</link>
		<comments>http://www.wpwordpress.com/how-to-exclude-certain-categories#comments</comments>
		<pubDate>Fri, 18 Sep 2009 07:26:00 +0000</pubDate>
		<dc:creator>Lego Lee</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.wpwordpress.com/?p=159</guid>
		<description><![CDATA[<p>There are 2 ways to exclude certain categories from your blog, one is use wordpress plugin named... <a href="http://www.wpwordpress.com/how-to-exclude-certain-categories">Read more</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-exclude-certain-categories"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.wpwordpress.com%2Fhow-to-exclude-certain-categories&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>There are 2 ways <strong>to exclude certain categories from your blog</strong>, one is use wordpress plugin named <a href="http://wordpress.org/extend/plugins/advanced-category-excluder"></a>Advanced Category Excluder. This plugin was born because there was a no other real alternative to enable content sparationd and some CMS like functionalities in WordPress. The main goal was, to enhance WordPress’s functionalities, to hide some unwanted categories, from defined parts of the blog.</p>
<p>The alternative way is without plugin, you can add the below code inside <a href="http://codex.wordpress.org/The_Loop">the loop</a> then it will work.</p>
<pre><code>&lt;?php
if ( have_posts() ) : query_posts($query_string .'&amp;cat=-1,-2'); while ( have_posts() ) : the_post();
?&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwordpress.com/how-to-exclude-certain-categories/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
