<?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; Wordpress</title>
	<atom:link href="http://webmasters-blog.com/tag/wordpress/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>How to Avoid Duplicate Posts in Multiple Loops.</title>
		<link>http://webmasters-blog.com/how-to-avoid-duplicate-posts-in-multiple-loops/</link>
		<comments>http://webmasters-blog.com/how-to-avoid-duplicate-posts-in-multiple-loops/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 05:02:59 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[loops]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=514</guid>
		<description><![CDATA[In the recent days almost every wordpress blog is using &#8216;Magazine&#8217; type themes. But one problem associated with Magazine themes is that they use more than one loop on their blog home page for a solution to avoiding duplicate posts on the second loop. Well this lttle php hack can solve this problem for you. [...]]]></description>
			<content:encoded><![CDATA[<p><img title="Avoid Duplicate Posts in Multiple" src="http://webmasters-blog.com/wp-content/uploads/2010/07/Avoid-Duplicate-Posts-in-Multiple-Loops.jpg" alt="Avoid Duplicate Posts in Multiple" /></p>
<p>In the recent days almost every wordpress blog is using &#8216;Magazine&#8217; type themes. But one problem associated with Magazine themes is that they use more than one loop on their blog home page for a solution to avoiding duplicate posts on the second loop.</p>
<p>Well this lttle php hack can solve this problem for you.</p>
<p>1. Let’s start by creating a simple PHP array, and put all post IDs from the first loop in it.</p>
<blockquote><p>&lt;h2&gt;Loop n°1&lt;/h2&gt;<br />
&lt;?php<br />
$ids = array();<br />
while (have_posts()) : the_post();<br />
the_title();<br />
?&gt;<br />
&lt;br /&gt;</p>
<p>&lt;?php $ids[]= $post-&gt;ID;<br />
endwhile; ?&gt;</p></blockquote>
<p>2. Now, the second loop: we use the PHP function in_array() to check if a post ID is contained in the $ids array. If the ID isn’t contained in the array, we can display the post because it wasn’t displayed in the first loop.</p>
<blockquote><p>&lt;h2&gt;Loop n°2&lt;/h2&gt;<br />
&lt;?php<br />
query_posts(&#8220;showposts=50&#8243;);<br />
while (have_posts()) : the_post();<br />
if (!in_array($post-&gt;ID, $ids)) {<br />
the_title();?&gt;<br />
&lt;br /&gt;<br />
&lt;?php }<br />
endwhile; ?&gt;</p></blockquote>
<p><strong>How it works:</strong> At the time the first loop will be executed, all IDs of posts contained within it are put into an array variable. Now when the second loop is executed, we check that the current post ID hasn’t already been displayed in the first loop by referring to the array.</p>
<p>That&#8217;s all.</p>
<p><strong>Source: </strong><a href="http://www.wprecipes.com/how-to-use-two-or-more-loops-without-duplicate-posts">http://www.wprecipes.com/how-to-use-two-or-more-loops-without-duplicate-posts</a></p>

	Tags: <a href="http://webmasters-blog.com/tag/loops/" title="loops" rel="tag nofollow">loops</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/whats-new-in-wordpress-2-8/" title="What&#8217;s new in WordPress 2.8? (June 13, 2009)">What&#8217;s new in WordPress 2.8?</a> (3)</li>
	<li><a href="http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/" title="Top 10 WordPress .htaccess hacks (April 19, 2009)">Top 10 WordPress .htaccess hacks</a> (2)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/how-to-avoid-duplicate-posts-in-multiple-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically add a custom field when a post is published on WordPress.</title>
		<link>http://webmasters-blog.com/automatically-add-a-custom-field-when-a-post-is-published-on-wordpress/</link>
		<comments>http://webmasters-blog.com/automatically-add-a-custom-field-when-a-post-is-published-on-wordpress/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 06:26:47 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=457</guid>
		<description><![CDATA[Most of the WordPress users now use highly code themes that add to the functions and looks of their blogs. And for many such functions you need a add a custom field while publishing any post. Obviously many of us dont like to do this extra thing while blogging. So here&#8217;s a solution to how [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://webmasters-blog.com/wp-content/uploads/2010/07/Automatically-add-a-custom-field-when-a-post-is-published-on-WordPress.png" alt="" width="229" height="228" /></p>
<p>Most of the WordPress users now use highly code themes that add to the functions and looks of their blogs. And for many such functions you need a add a custom field while publishing any post. Obviously many of us dont like to do this extra thing while blogging.</p>
<p>So here&#8217;s a solution to how to do it automatically.</p>
<p>Just goto your Dashboard > Appearance > Editor and look for &#8216;functions.php&#8217; file.</p>
<p>The only thing you have to do is to edit the cutsom field name on line 6. </p>
<blockquote><p>add_action(&#8216;publish_page&#8217;, &#8216;add_custom_field_automatically&#8217;);<br />
add_action(&#8216;publish_post&#8217;, &#8216;add_custom_field_automatically&#8217;);<br />
function add_custom_field_automatically($post_ID) {<br />
	global $wpdb;<br />
	if(!wp_is_post_revision($post_ID)) {<br />
		add_post_meta($post_ID, &#8216;field-name&#8217;, &#8216;custom value&#8217;, true);<br />
	}<br />
}
</p></blockquote>
<p>Thats it, now a custom field will be added automatically every time you publish a post on your WordPress blog.</p>

	Tags: <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/whats-new-in-wordpress-2-8/" title="What&#8217;s new in WordPress 2.8? (June 13, 2009)">What&#8217;s new in WordPress 2.8?</a> (3)</li>
	<li><a href="http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/" title="Top 10 WordPress .htaccess hacks (April 19, 2009)">Top 10 WordPress .htaccess hacks</a> (2)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-avoid-duplicate-posts-in-multiple-loops/" title="How to Avoid Duplicate Posts in Multiple Loops. (July 3, 2010)">How to Avoid Duplicate Posts in Multiple Loops.</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/automatically-add-a-custom-field-when-a-post-is-published-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Author&#8217;s Gravatars to Posts in WordPress</title>
		<link>http://webmasters-blog.com/add-authors-gravatars-to-posts-in-wordpress/</link>
		<comments>http://webmasters-blog.com/add-authors-gravatars-to-posts-in-wordpress/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 04:30:53 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=415</guid>
		<description><![CDATA[Adding Gravatar to your blog, makes your blog&#8217;s comments look more attractive. That&#8217;s why it have been incorporated in the WordPress core. Now comes the idea of adding your gravatar to your post on WordPress. This can be pretty useful in blogs with multiple authors, so that readers can quickly identify, who wrote this post. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-416" title="Add Author's Gravatars to Posts in WordPress" src="http://webmasters-blog.com/wp-content/uploads/2009/08/Add-Authors-Gravatars-to-Posts-in-WordPress.jpg" alt="Add Author's Gravatars to Posts in WordPress" width="240" height="240" /></p>
<p>Adding Gravatar to your blog, makes your blog&#8217;s comments look more attractive. That&#8217;s why it have been incorporated in the WordPress core.</p>
<p>Now comes the idea of adding your gravatar to your post on WordPress. This can be pretty useful in blogs with multiple authors, so that readers can quickly identify, who wrote this post.</p>
<p>And adding this feature is real easy. Just add this code in your single.php -</p>
<blockquote><p>&lt;?php echo get_avatar( get_the_author_email(), &#8217;80&#8242; ); ?&gt;</p></blockquote>
<p>You have to add this, where you want to display the Author&#8217;s gravatar. In this code &#8220;80&#8243; is the size of the gravatar, you can change it to any value you want.</p>
<p>Pretty simple!! huh <img src='http://webmasters-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

	Tags: <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/whats-new-in-wordpress-2-8/" title="What&#8217;s new in WordPress 2.8? (June 13, 2009)">What&#8217;s new in WordPress 2.8?</a> (3)</li>
	<li><a href="http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/" title="Top 10 WordPress .htaccess hacks (April 19, 2009)">Top 10 WordPress .htaccess hacks</a> (2)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-avoid-duplicate-posts-in-multiple-loops/" title="How to Avoid Duplicate Posts in Multiple Loops. (July 3, 2010)">How to Avoid Duplicate Posts in Multiple Loops.</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/add-authors-gravatars-to-posts-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Latest Registered Users list in your sidebar.</title>
		<link>http://webmasters-blog.com/add-latest-registered-users-list-in-your-sidebar/</link>
		<comments>http://webmasters-blog.com/add-latest-registered-users-list-in-your-sidebar/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 04:34:38 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=396</guid>
		<description><![CDATA[If you are getting a lot of user registrations and want to flaunt it, then what else can be the best than show your &#8220;Latest User Registeres&#8221; list in your sidebar. What you have to do is just paste the following code to your sidebar - &#60;h2&#62;Latest registered users&#60;/h2&#62; &#60;ul&#62; &#60;?php $usernames = $wpdb-&#62;get_results(&#8220;SELECT user_nicename, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-395" title="Add Latest Registered Users list in your sidebar" src="http://webmasters-blog.com/wp-content/uploads/2009/06/Add-Latest-Registered-Users-list-in-your-sidebar.jpg" alt="Add Latest Registered Users list in your sidebar" width="400" height="400" /></p>
<p>If you are getting a lot of user registrations and want to flaunt it, then what else can be the best than show your &#8220;Latest User Registeres&#8221; list in your sidebar.</p>
<p>What you have to do is just paste the following code to your sidebar -</p>
<blockquote><p>&lt;h2&gt;Latest registered users&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php<br />
$usernames = $wpdb-&gt;get_results(&#8220;SELECT user_nicename, user_url FROM $wpdb-&gt;users ORDER BY ID DESC LIMIT <span style="color: #ff0000;">5</span>&#8220;);</p>
<p>foreach ($usernames as $username) {<br />
echo &#8216;&lt;li&gt;&lt;a href=&#8221;&#8216;.$username-&gt;user_url.&#8217;&#8221;&gt;&#8217;.$username-&gt;user_nicename.&#8221;&lt;/a&gt;&lt;/li&gt;&#8221;;<br />
}<br />
?&gt;</p>
<p>&lt;/ul&gt;</p></blockquote>
<p>This will display a list of latest 5 registered users in your sidebart along with the url.</p>
<p>You can change the number of users in list by simply changing the number 5 (in red) in above code.</p>

	Tags: <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/whats-new-in-wordpress-2-8/" title="What&#8217;s new in WordPress 2.8? (June 13, 2009)">What&#8217;s new in WordPress 2.8?</a> (3)</li>
	<li><a href="http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/" title="Top 10 WordPress .htaccess hacks (April 19, 2009)">Top 10 WordPress .htaccess hacks</a> (2)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-avoid-duplicate-posts-in-multiple-loops/" title="How to Avoid Duplicate Posts in Multiple Loops. (July 3, 2010)">How to Avoid Duplicate Posts in Multiple Loops.</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/add-latest-registered-users-list-in-your-sidebar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in WordPress 2.8?</title>
		<link>http://webmasters-blog.com/whats-new-in-wordpress-2-8/</link>
		<comments>http://webmasters-blog.com/whats-new-in-wordpress-2-8/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 04:10:58 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=385</guid>
		<description><![CDATA[The WordPress Team is continuously striving hard to WordPress as the best Content Management System and enhance the User experience with WordPress. Now, WordPress has released its latest version &#8211; 2.8 It has added a bunch of features to this latest 2.8 version of WordPress. Some of the Key features include : Integration of Code [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-387" title="What's new in WordPress 2.8" src="http://webmasters-blog.com/wp-content/uploads/2009/06/Whats-new-in-WordPress-2.8.jpg" alt="What's new in WordPress 2.8" width="300" height="275" /></p>
<p>The WordPress Team is continuously striving hard to WordPress as the best Content Management System and enhance the User experience with WordPress. Now, WordPress has released its latest version &#8211; 2.8</p>
<p>It has added a bunch of features to this latest 2.8 version of WordPress.</p>
<p>Some of the Key features include :</p>
<ul>
<li><strong>Integration of Code Editor in Themes Editor &#8211; </strong>Now you can edit your WordPress themes just like Code Editor with all the syntax highlighting and Line Numbers, making theme editing a lot easier.</li>
<li><strong>Themes installation from Admin Dashboard</strong> &#8211; Now you can install WordPress themes right from your Dashboard, no need to upload themes using FTP programs. You can even browse themes from your dashboard and install whichever theme you like by just one click.</li>
<li><strong>Support IIS 7.0 URL Rewrite Module -</strong> This will enable use of  WordPress&#8217; Pretty URLs on IIS servers.</li>
</ul>
<p>You check out the complete list of New Features on <a href="http://codex.wordpress.org/Version_2.8">WordPress&#8217; site</a>.</p>

	Tags: <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/top-10-wordpress-htaccess-hacks-awesome/" title="Top 10 WordPress .htaccess hacks (April 19, 2009)">Top 10 WordPress .htaccess hacks</a> (2)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-avoid-duplicate-posts-in-multiple-loops/" title="How to Avoid Duplicate Posts in Multiple Loops. (July 3, 2010)">How to Avoid Duplicate Posts in Multiple Loops.</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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/whats-new-in-wordpress-2-8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Top 10 WordPress .htaccess hacks</title>
		<link>http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/</link>
		<comments>http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 04:13:41 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=332</guid>
		<description><![CDATA[.htaccess, the file which control the Apache webserver, is very useful and allows you to do a lot of things. In this article, let’s see how .htaccess can help you with your WordPress blog, for both security,functionnality and usability. Warning When editing or modifying the .htaccess file of your WordPress blog, make sure to always [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-333" title="htaccess" src="http://webmasters-blog.com/wp-content/uploads/2009/04/htaccess.jpg" alt="htaccess" width="511" height="157" /></p>
<p>.htaccess, the file which control the Apache webserver, is very useful and allows you to do a lot of things. In this article, let’s see how .htaccess can help you with your WordPress blog, for both security,functionnality and usability.</p>
<h2>Warning</h2>
<p><em>When editing or modifying the .htaccess file of your WordPress blog, make sure to <strong>always have a backup</strong> that you can restore in case of something went wrong.</em></p>
<h2>1 &#8211; Redirect WordPress RSS feeds to feedburner with .htaccess</h2>
<p>Which blogger doesn’t use feedburner? Sure, feedburner is a very nice service, allowing you to know how many people suscribed to your rss feeds. The only problem is that you must edit your theme files to manually change the rss url. Happilly, there’s a nice hack, using .htaccess, which will make you save a lot of time!<br />
Don&#8217;t forget to modify line 6 before applying this code!</p>
<blockquote><p># temp redirect wordpress content feeds to feedburner<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine on<br />
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]<br />
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]<br />
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds2.feedburner.com/catswhocode [R=302,NC,L]<br />
&lt;/IfModule&gt;</p></blockquote>
<p><strong>Source: <a href="http://www.wprecipes.com/how-to-redirect-wordpress-rss-feeds-to-feedburner-with-htaccess">How to redirect WordPress rss feeds to feedburner</a></strong></p>
<h2>2 &#8211; Remove /category/ from your WordPress url</h2>
<p>By default, WordPress category permalinks are displayed that way:</p>
<blockquote><p>http://webmasters-blog.com/category/wordpress/</p></blockquote>
<p>As you can see, the <em>category</em> in the url is pretty useless. Here’s how to remove it:<br />
First backup your <em>.htaccess</em> file. Then, open it and append the following line:</p>
<blockquote><p>RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L]</p></blockquote>
<p>Once saved, your categories pages will be displayed like this:</p>
<blockquote><p>http://webmasters-blog.com/wordpress/</p></blockquote>
<p><strong>Source: <a href="http://www.wprecipes.com/how-to-remove-category-from-your-wordpress-url">How to remove category from your WordPress url</a></strong></p>
<h2>3 &#8211; Using browser cache</h2>
<p>A very good way to optimize your blog loading time is to force the use of the browser cache. This code will not improve your blog loading time directly, but it will save some work to the server by sending a 304 not modified status when the requested element haven&#8217;t been modified.</p>
<blockquote><p>FileETag MTime Size<br />
&lt;ifmodule mod_expires.c&gt;<br />
&lt;filesmatch &#8220;\.(jpg|gif|png|css|js)$&#8221;&gt;<br />
ExpiresActive on<br />
ExpiresDefault &#8220;access plus 1 year&#8221;<br />
&lt;/filesmatch&gt;<br />
&lt;/ifmodule&gt;</p></blockquote>
<p><strong>Source: <a href="http://www.wordpress-tutoriel.com/tutoriel/comment-accelerer-le-temps-de-chargement-de-votre-blog/">Comment accelerer le temps de chargement de votre blog</a></strong></p>
<h2>4 &#8211; Compress static data</h2>
<p>Do you know that it is possible to send compressed data to the visitors, which will be decompressed by the client? This code will definitely save you (and your visitor) bandwidth and reduce your pages weight.</p>
<blockquote><p>AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html<br />
BrowserMatch ^Mozilla/4.0[678] no-gzip<br />
BrowserMatch bMSIE !no-gzip !gzip-only-text/html</p></blockquote>
<h2>5 &#8211; Redirect Day and name permalinks to /%postname%/</h2>
<p>The first thing to do is to login to your WordPress admin, go to Settings → Permalinks and select custom. Fill out the field with <strong>/%postname%/</strong>.<br />
Your permalinks will now look like the ones on this blog:</p>
<pre>http://www.yourblog.com/name-of-the-post</pre>
<p>Now we got to redirect all backlinks using the old permalinks structure to the new permalink structure. To do so, you’ll have to edit the .htaccess file, located in WordPress root directory.<br />
Paste the following line in your .htaccess:</p>
<blockquote><p>RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.domain.com/$4</p></blockquote>
<p>Allright! You just changed your permalinks structure without loosing any backlinks!<br />
<strong>Source: <a href="http://www.wprecipes.com/redirect-day-and-name-permalinks-to-postname">Redirect day and name permalinks to postname</a></strong></p>
<h2>6 &#8211; How to: Deny comment posting to no referrer requests</h2>
<p>Are you sick and tired about the daily amount of spam comments received? Sure, there’s akismet, but here’s a little .htaccess trick to prevent spammers posting on your blog. The fact is that most spammers uses bots comming from nowhere. This code will look for the referrer (the page from where the commentator come from) and will deny commenting if the commentator try to access the wp-comments-post.php file without directly comming from your blog.<br />
Just change the line 4 and specify your blog url there.</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{REQUEST_METHOD} POST<br />
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*<br />
RewriteCond %{HTTP_REFERER} !.*yourblog.com.* [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^$<br />
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]</p></blockquote>
<p><strong>Source: <a href="http://www.wprecipes.com/how-to-deny-comment-posting-to-no-referrer-requests">How to deny comment posting to no referrer requests</a></strong></p>
<h2>7 &#8211; Redirect visitors to a maintenance page</h2>
<p>When you&#8217;re upgrading your blog, or making theme/design changes, it isn&#8217;t a good idea to let people see your blog being tweaked, sometimes with design or code problems, or even worst, security gaps.<br />
The solution is to design a nice &#8220;maintenance page&#8221; and temporarily redirect your visitors to that page until you finished the maintenance.<br />
Replace maintenance.html (line 2) by the page you&#8217;d like to redirect your visitors, and the IP adress on line 3 by your own ip.<br />
Note that a 302 redirection is used, to avoid search engines indexing the maintenance page instead of your real homepage!</p>
<blockquote><p>RewriteEngine on<br />
RewriteCond %{REQUEST_URI} !/maintenance.html$<br />
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123<br />
RewriteRule $ /maintenance.html [R=302,L]</p></blockquote>
<p><strong>Source: <a href="http://www.woueb.net/2007/07/25/comment-faire-une-page-d-accueil-pour-les-internautes/">Comment faire une page d&#8217;accueil pour les internautes</a></strong></p>
<h2>8 &#8211; Protect your WordPress blog from hotlinking</h2>
<p>Hotlinking is the use of an image from one site into a web page belonging to another site. Many bloggers are hotlinked, and have their bandwidth used on another websites. This very helpful code will protect your WordPress blog from hotlinking.</p>
<blockquote><p>RewriteEngine On<br />
#Replace ?mysite\.com/ with your blog url<br />
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]<br />
RewriteCond %{HTTP_REFERER} !^$<br />
#Replace /images/nohotlink.jpg with your &#8220;don&#8217;t hotlink&#8221; image url<br />
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]</p></blockquote>
<p><strong>Source: <a href="http://www.wprecipes.com/how-to-protect-your-wordpress-blog-from-hotlinking">How to protect your WordPress blog from hotlinking</a></strong></p>
<h2>9 &#8211; Allow only your IP adress on the wp-admin directory</h2>
<p>Excepted the case of a collaborative blog, only you should be allowed to visit the wp-admin directory. If you have a static IP, this code will do the job.<br />
All you have to do is to enter your static IP adress on line 8. Note that you can add more IPs if needed, by creating a new line with: <em>allow from xx.xx.xxx.xx</em> inside.</p>
<blockquote><p>AuthUserFile /dev/null<br />
AuthGroupFile /dev/null<br />
AuthName &#8220;Example Access Control&#8221;<br />
AuthType Basic<br />
&lt;LIMIT GET&gt;<br />
order deny,allow<br />
deny from all<br />
allow from xx.xx.xx.xx<br />
&lt;/LIMIT&gt;</p></blockquote>
<p><strong>Source: <a href="http://www.reubenyau.com/protecting-the-wordpress-wp-admin-folder/">Protecting the WordPress wp-admin folder</a></strong></p>
<h2>10 &#8211; Banning a WordPress Spammer With .htaccess</h2>
<p>You know it, spam is very annoying. In the case of a particular person/bot spamming you, you can easily avoid it by blacklisting the IP.<br />
Simply replace the IP adress on line 3 by the spammer&#8217;s IP. You can add more spammers by creating a new line with <em>deny from xxx.xx.xxx.xxx</em> inside.</p>
<blockquote><p>&lt;Limit GET POST&gt;<br />
order allow,deny<br />
deny from 200.49.176.139<br />
allow from all<br />
&lt;/Limit&gt;</p></blockquote>
<p><strong>Source: <a href="http://lorelle.wordpress.com/2007/09/20/the-easiest-way-to-ban-a-wordpress-spammer/">The easiest way to ban a WordPress spammer</a></strong></p>

	Tags: <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/whats-new-in-wordpress-2-8/" title="What&#8217;s new in WordPress 2.8? (June 13, 2009)">What&#8217;s new in WordPress 2.8?</a> (3)</li>
	<li><a href="http://webmasters-blog.com/howto-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-avoid-duplicate-posts-in-multiple-loops/" title="How to Avoid Duplicate Posts in Multiple Loops. (July 3, 2010)">How to Avoid Duplicate Posts in Multiple Loops.</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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://webmasters-blog.com/top-10-wordpress-htaccess-hacks-awesome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reset your WordPress Admin Password manually.</title>
		<link>http://webmasters-blog.com/howto-reset-your-wordpress-admin-password-manually/</link>
		<comments>http://webmasters-blog.com/howto-reset-your-wordpress-admin-password-manually/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 13:59:56 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=307</guid>
		<description><![CDATA[It may happen sometime that you may lost the password for admin account for WordPress blog. Retrieving it can be a real pain. If you haven&#8217;t updated your email in any direct wordpress installation from your webhost, then retrieving your old password can become almost impossible. But if you have admin access to phpMyAdmin for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-308" title="reset-wordpress-password-manually-mysql" src="http://webmasters-blog.com/wp-content/uploads/2009/04/reset-wordpress-password-manually-mysql.jpg" alt="reset-wordpress-password-manually-mysql" width="356" height="313" /></p>
<p>It may happen sometime that you may lost the password for admin account for WordPress blog. Retrieving it can be a real pain. If you haven&#8217;t updated your email in any direct wordpress installation from your webhost, then retrieving your old password can become almost impossible.</p>
<p>But if you have admin access to phpMyAdmin for your blog, then you can change password for your wordpress blog by executing a simple SQL query.</p>
<p>For this you need to login to your phpMyAdmin panel, which you can easily do through your hots&#8217;s cpanel. Now, select the database for WordPress blog you want to change password. <strong>First of all create a backup of your database</strong>, before executing any SQL query. After that click on the &#8220;SQL&#8221; button, to open the SQL query window, as shown below.</p>
<p><img class="alignnone size-full wp-image-309" title="wordpress-phpmyadmin-change-password-admin" src="http://webmasters-blog.com/wp-content/uploads/2009/04/wordpress-phpmyadmin-change-password-admin.jpg" alt="wordpress-phpmyadmin-change-password-admin" width="487" height="144" /></p>
<p>Then, paste the following code into the textarea in the newly opened window. Don&#8217;t forget to modify the password(in red) before executing it.</p>
<blockquote><p>UPDATE &#8216;wp_users&#8217; SET &#8216;user_pass&#8217; = MD5(&#8216;<span style="color: #ff0000;">PASSWORD</span>&#8216;) WHERE &#8216;user_login&#8217; =&#8217;admin&#8217; LIMIT 1;</p></blockquote>
<p>Thats it you have successfully changed the password for your wordpress admin account, now login with your new WordPress password.</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/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-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</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-reset-your-wordpress-admin-password-manually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display &#8220;Most Popular&#8221; posts on sidebar.</title>
		<link>http://webmasters-blog.com/howto-display-most-popular-posts-on-sidebar-wordpress/</link>
		<comments>http://webmasters-blog.com/howto-display-most-popular-posts-on-sidebar-wordpress/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 13:30:08 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=303</guid>
		<description><![CDATA[If you have been blogging since some months/years and your blog has been getting good number of comments, you may have notice that some posts are getting more comments that other posts. This means that some posts are more popular than other posts. It will be a good idea to display your &#8220;Most Popular&#8221; posts [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-304" title="most-popular-wordpress" src="http://webmasters-blog.com/wp-content/uploads/2009/04/most-popular-wordpress.jpg" alt="most-popular-wordpress" width="400" height="400" /></p>
<p>If you have been blogging since some months/years and your blog has been getting good number of comments, you may have notice that some posts are getting more comments that other posts. This means that some posts are more popular than other posts.</p>
<p>It will be a good idea to display your &#8220;Most Popular&#8221; posts in the sidebar. This will make your visitors stay longer on your blog and more chances of them subscribing your RSS feed.</p>
<p>Now the &#8220;Most Popular&#8221; posts can be sorted out based on number of comments or number of views.</p>
<p>Plugins using most views as a criteria are -</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/popular-posts-plugin/">Popular Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/wp-postviews-plus-widget/">WP-PostViews Plus widget</a></li>
<li><a href="http://wordpress.org/extend/plugins/recently-popular/">Recently Popular</a></li>
<li><a href="http://wordpress.org/extend/plugins/wordpresscom-popular-posts/">WordPress.com Popular Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/yampp/">Yet Another Most Popular Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/kf-most-read/">KF most read</a></li>
</ul>
<p>There is one most popular plugin for this purpose <a href="http://wordpress.org/extend/plugins/popularity-contest/">Alex King&#8217;s &#8220;Popularity Contest&#8221;</a>. It uses various factors as criteria to sort out &#8220;Most Popular&#8221; posts list.</p>
<p>There are other plugins that use number of comments as a criteria for &#8220;Most Popular&#8221; posts. Here are some  -</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/most-popular-posts/">Most Popular Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/wp-comment-remix/">WP Comment Remix</a></li>
<li><a href="http://wordpress.org/extend/plugins/w-popularity/">wPopularity &#8211; Wordpres Plug-In</a></li>
</ul>
<p>If you don&#8217;t want install any plugin for &#8220;Most Popular&#8221; posts, then you can use following to display it. Just copy-paste the following code on your <em>sidebar.php</em> file. To change the number of displayed posts, simply change the 5 , highlighted in red to any number you want. Also if you want to change its title, just change &#8216;Popular Posts&#8217;, highlighted in green to anything of your choice.</p>
<blockquote><p>&lt;h2&gt;<span style="color: #339966;">Popular Posts</span>&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php $result = $wpdb-&gt;get_results(&#8220;SELECT comment_count,ID,post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , <span style="color: #ff0000;">5</span>&#8220;);<br />
foreach ($result as $post) {<br />
setup_postdata($post);<br />
$postid = $post-&gt;ID;<br />
$title = $post-&gt;post_title;<br />
$commentcount = $post-&gt;comment_count;<br />
if ($commentcount != 0) { ?&gt;<br />
&lt;li&gt;&lt;a href=&#8221;&lt;?php echo get_permalink($postid); ?&gt;&#8221; title=&#8221;&lt;?php echo $title ?&gt;&#8221;&gt;</p>
<p>&lt;?php echo $title ?&gt;&lt;/a&gt; {&lt;?php echo $commentcount ?&gt;}&lt;/li&gt;<br />
&lt;?php } } ?&gt;<br />
&lt;/ul&gt;</p></blockquote>

	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/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-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-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-display-most-popular-posts-on-sidebar-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display &#8220;Related Posts&#8221; with/without plugin.</title>
		<link>http://webmasters-blog.com/howto-display-related-posts-withwithout-plugin-wordpress/</link>
		<comments>http://webmasters-blog.com/howto-display-related-posts-withwithout-plugin-wordpress/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:26:56 +0000</pubDate>
		<dc:creator>Raman</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://webmasters-blog.com/?p=297</guid>
		<description><![CDATA[Displaying &#8220;Related Posts&#8221; after every posts can be very crucial in increasing pageviews for your blog. Again it does not come by default with WordPress installation. But there are many plugins available for the purpose of displaying &#8220;Related Posts&#8221;. Important one&#8217;s being - Yet Another Related Posts Plugin WordPress Related Posts WordPress Related Posts Plugin [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-298" title="wordpress_tag_cloud" src="http://webmasters-blog.com/wp-content/uploads/2009/04/wordpress_tag_cloud.gif" alt="wordpress_tag_cloud" width="559" height="536" /> Displaying &#8220;Related Posts&#8221; after every posts can be very crucial in increasing pageviews for your blog.  Again it does not come by default with WordPress installation. But there are many plugins available for the purpose of displaying &#8220;Related Posts&#8221;. Important one&#8217;s being -</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin</a>
</li>
<li><a href="http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/">WordPress Related Posts</a>
</li>
<li><a href="http://wordpress.org/extend/plugins/wordpress-related-posts/">WordPress Related Posts Plugin</a>
</li>
<li><a href="http://wordpress.org/extend/plugins/related-posts-by-category/">Related Posts by Category</a>
</li>
<li><a href="http://wordpress.org/extend/plugins/contextual-related-posts/">Contextual Related Posts</a>
</li>
</ul>
<p>The list is quiet long. The most popular among these is Yet Another Related Posts Plugin aka &#8220;YARPP&#8221;.  But here on my blog I use a Plugin &#8220;<a href="http://wordpress.org/extend/plugins/simple-tagging-plugin/">Simple Tagging</a>&#8221; which can be used both for managing tags and displaying &#8220;Related Posts&#8221; based on tags.  But if you don&#8217;t want to install another plugin on your server, then here is the code for you. Just place the following code anywhere you want to show &#8220;Related Posts&#8221; within loop. The code will display &#8220;Related Posts&#8221; based on the current post tag(s).</p>
<blockquote><p>&lt;?php //for use in the loop, list 5 post titles related to first tag on current post $tags = wp_get_post_tags($post-&gt;ID); if ($tags) {   echo &#8216;Related Posts&#8217;;   $first_tag = $tags[0]-&gt;term_id;   $args=array(     &#8216;tag__in&#8217; =&gt; array($first_tag),     &#8216;post__not_in&#8217; =&gt; array($post-&gt;ID),     &#8216;showposts&#8217;=&gt;5,     &#8216;caller_get_posts&#8217;=&gt;1    );   $my_query = new WP_Query($args);   if( $my_query-&gt;have_posts() ) {     while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;       &lt;p&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;        &lt;?php     endwhile;   } } ?&gt;</p></blockquote>

	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/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-show-recent-comments-in-your-wordpress-blog/" title="Show recent comments in your WordPress Blog. (April 15, 2009)">Show recent comments in your WordPress Blog.</a> (2)</li>
	<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-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-display-related-posts-withwithout-plugin-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>
