<?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>PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</title>
	
	<link>http://www.phpmagicbook.com</link>
	<description>PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips</description>
	<lastBuildDate>Mon, 05 Oct 2009 09:37:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</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" href="http://feeds.feedburner.com/phpmagicbook" type="application/rss+xml" /><feedburner:emailServiceId>phpmagicbook</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Enable Gravatar/Avatar at Your Website – Gravatar Image PHP Script</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/My5sabTWSh4/</link>
		<comments>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 09:37:06 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[displaypic]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=499</guid>
		<description><![CDATA[You might have already created an account at gravatar (Globally Recognized Avatars) and enjoying your display picture or avatar at forums and blogs when you just post your comment with your email and there you are &#8212; it displays your avatar along with your comment. If you are a developer and you create websites &#8211; [...]<p><a href="http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/">Enable Gravatar/Avatar at Your Website &#8211; Gravatar Image PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/10/gravatar.png" alt="gravatar" title="gravatar" width="200" height="44" class="alignright size-full wp-image-500" />You might have already created an account at <a rel="nofollow" target="_blank" href="http://en.gravatar.com/">gravatar</a> (Globally Recognized Avatars) and enjoying your display picture or avatar at forums and blogs when you just post your comment with your email and there you are &#8212; it displays your avatar along with your comment. If you are a developer and you create websites &#8211; PHP websites &#8211; and wondering how you can enable gravatars / avatars in your next project then here is very easy to use working solution &#8211; PHP script to enable gravatar at your PHP website / blog / forum / project.</p>
<p><span id="more-499"></span></p>
<p>Copy the following code. Paste it in a file, save it in PHP extension, upload it or use it at localhost &#8211; just change the <strong>usersEmail</strong> value to your email address, if you are already at gravatars website and hit it. Other instructions for customization of script &#8211; you can find in the script. e.g. size of gravatar, default image, rating etc.</p>
<h4>Gravatars PHP Script for Your Website</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// The users email, passed to Gravatar</span>
<span style="color: #000088;">$usersEmail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;myemail@live.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// default avatar to load if Gravatar doesn't find one</span>
<span style="color: #000088;">$defaultImage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://domain.com/default.png&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The size of the image</span>
<span style="color: #000088;">$avatarSize</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;50&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Minimum rating for your site</span>
<span style="color: #666666; font-style: italic;">// Possible values (G, PG, R, X)</span>
<span style="color: #000088;">$avatarRating</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;G&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Border around the image</span>
<span style="color: #000088;">$avatarBorder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;000000&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// URL for Gravatar</span>
<span style="color: #000088;">$gravatarURL</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.gravatar.com/avatar.php?gravatar_id=<span style="color: #009933; font-weight: bold;">%s</span>&amp;default=<span style="color: #009933; font-weight: bold;">%s</span>&amp;size=<span style="color: #009933; font-weight: bold;">%s</span>&amp;border=<span style="color: #009933; font-weight: bold;">%s</span>&amp;rating=<span style="color: #009933; font-weight: bold;">%s</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$avatarURL</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span>
<span style="color: #009900;">&#40;</span>
	<span style="color: #000088;">$gravatarURL</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$usersEmail</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$defaultImage</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarSize</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarBorder</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarRating</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;img src=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarURL</span> . &quot;</span><span style="color: #0000ff;">&quot; width=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarSize</span> . &quot;</span><span style="color: #0000ff;">&quot; height=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarSize</span> . &quot;</span><span style="color: #0000ff;">&quot; /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/">Enable Gravatar/Avatar at Your Website &#8211; Gravatar Image PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/text-to-image-using-php/" title="Text To Image Using PHP">Text To Image Using PHP</a></li><li><a href="http://www.phpmagicbook.com/captcha-image-number-verification/" title="Captcha &#8211; Image And Number Verification Using PHP">Captcha &#8211; Image And Number Verification Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-onload/" title="Random Single Image Onload Using PHP">Random Single Image Onload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-javascript-based-image-gallery/" title="PHP Javascript Based Auto Populated Image Gallery">PHP Javascript Based Auto Populated Image Gallery</a></li><li><a href="http://www.phpmagicbook.com/display-images-from-folder/" title="Auto Display Images From Folder Using PHP">Auto Display Images From Folder Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-display-on-page-reload/" title="Random Single Image Display On Page Reload Using PHP">Random Single Image Display On Page Reload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-photo-slide-show/" title="Auto Create PHP Photo Slide Show Using PHP">Auto Create PHP Photo Slide Show Using PHP</a></li><li><a href="http://www.phpmagicbook.com/image-gallery/" title="Auto Create Image Gallery from Folder Using PHP">Auto Create Image Gallery from Folder Using PHP</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/MyFqxnUbqUI5qkPDI2eMPgJFyD0/0/da"><img src="http://feedads.g.doubleclick.net/~a/MyFqxnUbqUI5qkPDI2eMPgJFyD0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MyFqxnUbqUI5qkPDI2eMPgJFyD0/1/da"><img src="http://feedads.g.doubleclick.net/~a/MyFqxnUbqUI5qkPDI2eMPgJFyD0/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/</feedburner:origLink></item>
		<item>
		<title>Allow htaccess and Mod Rewrite in Wamp</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/161xqZvxJHs/</link>
		<comments>http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 09:19:26 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Mod Rewrite]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[modrewrite]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=498</guid>
		<description><![CDATA[You must enable mod_rewrite before you can use it. If you want to enable it in httpd.conf, then use 
Options FollowSymLinks Fileinfo
or
Options SymLinksIfOwnerMatch Fileinfo
If you wish to enable mod_rewrite at the .htaccess level (i.e. only in certain (sub)directories within each vHost and not for all (sub)directories of each vHost), then you must set allowOverride Options [...]<p><a href="http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/">Allow htaccess and Mod Rewrite in Wamp</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>You must enable mod_rewrite before you can use it. If you want to enable it in httpd.conf, then use </p>
<p>Options FollowSymLinks Fileinfo<br />
or<br />
Options SymLinksIfOwnerMatch Fileinfo</p>
<p>If you wish to enable mod_rewrite at the .htaccess level (i.e. only in certain (sub)directories within each vHost and not for all (sub)directories of each vHost), then you must set allowOverride Options (at a minimum) in httpd.conf, and place one of </p>
<p>Options +FollowSymLinks<br />
or<br />
Options +SymLinksIfOwnerMatch </p>
<p>in the .htaccess file(s) to enable mod_rewrite.</p>
<p><span id="more-498"></span></p>
<p>In the latter case, it is usual to set Options Fileinfo (and any others) in httpd.conf, and then set Options +FollowSymLinks in .htaccess along with +/-indexes, +/-MultiViews, etc. as desired. Take a look at the +/- add/subtract option syntax versus fixed Option declarations &#8212; You&#8217;ll likely want to establish fixed baseline Options in httpd.conf, and then use the add/subtract syntax at the .htaccess level. For security, don&#8217;t enable any Option unless you&#8217;re sure you need it.</p>
<p>If you did not get any clue what the crap was just above, just ignore it and do the following.</p>
<p>Go to <strong>Wamp</strong> -> Left click at icon in the taskbar -> Click <strong>Config files</strong> -> <strong>httpd.conf</strong><br />
A file will be opened.<br />
Search rewrite in it.<br />
You will get:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">#LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Remove hash from the beginning (Uncomment it) e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Save the file. Mod Rewriting is enabled.</p>
<p>Open Notepad or Textpad or Dtreamweaver.<br />
Create new file.<br />
Save it as <strong>.htaccess</strong> in the required directory or root directory of website.<br />
Copy and paste the following in it.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Options +FollowSymLinks
RewriteEngine On</pre></div></div>

<p>And you are done. Use this .htacces file now to code onward and it will work.<br />
The above, when you uncommented the rewrite thing, you enabled mod-rewrite in wamp.</p>
<p>This case is important when there is involvement of redirecting and the use of .htaccess file at localhost. e.g. When you use WordPress at localhost for development purpose, then this method to allow .htaccess file and mod-rewrite for wamp is good. Its GoOoOOoOooD!</p>
<p><a href="http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/">Allow htaccess and Mod Rewrite in Wamp</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/" title=".htaccess Essential Tricks For Blog/Website Performance &#8211; Guide">.htaccess Essential Tricks For Blog/Website Performance &#8211; Guide</a></li><li><a href="http://www.phpmagicbook.com/redirect-wordpress-rss-feeds-to-feedburner/" title="Redirect WordPress RSS Feeds to Feedburner">Redirect WordPress RSS Feeds to Feedburner</a></li><li><a href="http://www.phpmagicbook.com/force-file-download-do-not-display-open-in-browser/" title="Force File download Using PHP &#8211; Do Not Display Open In Browser onclick">Force File download Using PHP &#8211; Do Not Display Open In Browser onclick</a></li><li><a href="http://www.phpmagicbook.com/dothtaccess-hacks/" title="Essential DotHtaccess Hacks">Essential DotHtaccess Hacks</a></li><li><a href="http://www.phpmagicbook.com/php-local-servers-download/" title="PHP &#8211; Local Servers Download">PHP &#8211; Local Servers Download</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/uvkODgFlIwC1W5aww2mRh6hGfQE/0/da"><img src="http://feedads.g.doubleclick.net/~a/uvkODgFlIwC1W5aww2mRh6hGfQE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/uvkODgFlIwC1W5aww2mRh6hGfQE/1/da"><img src="http://feedads.g.doubleclick.net/~a/uvkODgFlIwC1W5aww2mRh6hGfQE/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/</feedburner:origLink></item>
		<item>
		<title>PHP Script Not Working – Solution</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/OJWncOTpt-w/</link>
		<comments>http://www.phpmagicbook.com/php-script-not-working-solution/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 11:52:52 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Post & Get]]></category>
		<category><![CDATA[essentials]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[troubleshoot]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=435</guid>
		<description><![CDATA[Ever wondered that most of the PHP scripts you download, do not do anything. I mean you downloaded the PHP script, uploaded at your host or copied at localhost and when you run it, it will not display results. In most cases it happens. One reason might be that the script is not properly written. [...]<p><a href="http://www.phpmagicbook.com/php-script-not-working-solution/">PHP Script Not Working &#8211; Solution</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Ever wondered that most of the PHP scripts you download, do not do anything. I mean you downloaded the PHP script, uploaded at your host or copied at localhost and when you run it, it will not display results. In most cases it happens. One reason might be that the script is not properly written. But the fact is, scripts are written correctly in most cases. The problem is that the developers miss something very important in most cases. Next time you download scripts, those should run if you follow this instruction I am going to tell you.</p>
<p><span id="more-435"></span></p>
<p>Some PHP developers write code with <strong>Globals On</strong>. </p>
<p>Left click wamp icon -> <strong>config files -> php.ini</strong></p>
<p>When its open, search for <strong>register_globals</strong></p>
<p>These must be Off by default e.g.<br />
<strong>register_globals = Off</strong></p>
<p>Many developers were used to program in environment of On Globals. This makes programming easier but this method is vulnerable and security risk. You do not have to get variables which you post at the new page where PHP does something in case of Globals On. Sometimes developers still do the same thing.</p>
<p>This is not recommended.</p>
<p><strong>Globals should be off in PHP.ini and scripts should work while Globals are off.</strong></p>
<p>So the reason is obvious. Many scripts you download, you will see do not get variables when these are posted. Those are programmed in environment of Globals On (Easy way PHP Coding).</p>
<p>Next time you download a script and if that is not working, check that Variables are being requested after when these are posted or not.</p>
<h4>What to Do</h4>
<p>Suppose someone posts a form with his <strong>name</strong> and <strong>email</strong> with variables <strong>txtName</strong> and <strong>txtEmail</strong> which are text input names. txtName and txtEmail should be requested at the next PHP page. If these are not being called, then you will get Null result which will be empty.</p>
<p>Request these variables in the following manner at the next page at the top of everything where PHP code starts. In case of above example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$txtName</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;txtName&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$txtEmail</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;txtEmail&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now $txtName contains the name of user and $txtEmail contains the email and you can use these further. When some PHP script is not working, always see that if these variables are being requested by this manner at the next page? If not you can get every variable like this and the script will be working in most cases. You can also use $_Post instead of $_REQUEST.</p>
<p>Another reason is not using proper PHP starting tag.</p>
<h4>Wrong Tag</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span></pre></div></div>

<h4>Correct Usage of PHP Tag</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></pre></div></div>

<p>Some servers will output errors if you do not use proper PHP starting tag.</p>
<p>Also read <a href="http://www.phpmagicbook.com/php-post-and-get/">Post and Get</a> if this is not clear.</p>
<p><a href="http://www.phpmagicbook.com/php-script-not-working-solution/">PHP Script Not Working &#8211; Solution</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/php-creating-a-file/" title="Creating A File Using PHP">Creating A File Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-for-loop/" title="PHP For Loop">PHP For Loop</a></li><li><a href="http://www.phpmagicbook.com/php-ajax-email-form/" title="PHP AJAX Email Form">PHP AJAX Email Form</a></li><li><a href="http://www.phpmagicbook.com/php-while-loop/" title="PHP While Loop">PHP While Loop</a></li><li><a href="http://www.phpmagicbook.com/random-number-verification-simple-form-authentication/" title="Random Number Verification &#8211; Simple Form Authentication Using PHP">Random Number Verification &#8211; Simple Form Authentication Using PHP</a></li><li><a href="http://www.phpmagicbook.com/protect-php-dot-ini-file-from-being-viewed/" title="Protect php dot ini file from being viewed">Protect php dot ini file from being viewed</a></li><li><a href="http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/" title="Allow htaccess and Mod Rewrite in Wamp">Allow htaccess and Mod Rewrite in Wamp</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/image-gallery/" title="Auto Create Image Gallery from Folder Using PHP">Auto Create Image Gallery from Folder Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-do-while-loop/" title="PHP Do While Loop">PHP Do While Loop</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/dpJuiLskW_2gqQ3BBD8ozR24J3o/0/da"><img src="http://feedads.g.doubleclick.net/~a/dpJuiLskW_2gqQ3BBD8ozR24J3o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dpJuiLskW_2gqQ3BBD8ozR24J3o/1/da"><img src="http://feedads.g.doubleclick.net/~a/dpJuiLskW_2gqQ3BBD8ozR24J3o/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/php-script-not-working-solution/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/php-script-not-working-solution/</feedburner:origLink></item>
		<item>
		<title>Customizing WordPress Tags Cloud – A Guide</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/faOFXFqaC3M/</link>
		<comments>http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 22:16:11 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=389</guid>
		<description><![CDATA[
If you have already used some social networking website or you are a blogger then you definitely know what the tags are. WordPress offers Tags Cloud which can be customized the way you use it at your blog. By default WP Tag Cloud will generate limited number of tags in alphabetical order. Custom templates for [...]<p><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/">Customizing WordPress Tags Cloud &#8211; A Guide</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/tags-cloud.jpg" alt="tags-cloud" title="tags-cloud" width="500" height="300" class="alignnone size-full wp-image-390" /></p>
<p>If you have already used some social networking website or you are a blogger then you definitely know what the tags are. WordPress offers Tags Cloud which can be customized the way you use it at your blog. By default WP Tag Cloud will generate limited number of tags in alphabetical order. Custom templates for tags can be made which means that you can have a full page of tags as you want it. Look at the <a href="http://www.phpmagicbook.com/404/" target="_blank">404 page of phpmagicbook</a>. I have used tags to give the users some more options to browse if he gets distracted by &#8216;page not found error&#8217;. I was thinking to give my users all tags option to click at any one. Okay now this is just one use. You can have your own customized tags page which can contain just tags and nothing more. We explore some ways about how we can customize tags/tags template/tags page at our WordPress blog.</p>
<p><span id="more-389"></span></p>
<h4>Default Tags Cloud</h4>
<p>Paste the following code anywhere in your blog theme&#8217;s template files (e.g. 404 page, single post page etc.) to see default tags cloud in action:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Display All Tags</h4>
<p>Following code will give you all the WordPress tags which you have used in your blog.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'number=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Define Custom Font Size in Tags Cloud</h4>
<p>Following code will determine the smallest and largest size in your tags cloud.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smallest=8&amp;largest=22'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Random Ordered Tags Cloud</h4>
<p>Following code will generate random tags cloud which will not be in alphabetical order.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'order=RAND'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Tags Cloud Limited in Size &#038; Ordered by Number of Posts</h4>
<p>Following code will generate custom font sized tags cloud ordered by post frequency under a specific tag.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smallest=8&amp;largest=22&amp;number=30&amp;orderby=count'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Tags Cloud Format</h4>
<p>You can format Tags Cloud in <strong>flat</strong> (Default) format &#8211; separated by whitespace, <strong>list</strong> format and <strong>array</strong> format by using following method:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'format=list'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And there is ASC (Default), DESC and RAND order for Tags display order.<br />
Exclude and Include option to exclude and include tags and more&#8230;</p>
<h4>Mixing Things Up</h4>
<p>And finally with a bit of a magic you can add the bits and bytes into a full story of customized Tags Cloud for your own blog. A possible combination of code and example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_tag_cloud'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
wp_tag_cloud<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smallest=8&amp;largest=22&amp;unit=pt&amp;number=50&amp;format=flat&amp;orderby=name&amp;order=ASC&amp;exclude=garbagetag&amp;include=mytag'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Example: Browse Ajax Rain&#8217;s tags page to view the full tags option in action.</p>
<p><a rel="nofollow" target="_blank" href="http://www.ajaxrain.com/tagcloud.php" target="_blank"><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/ajax-rain-tags-cloud.jpg" alt="ajax-rain-tags-cloud" title="ajax-rain-tags-cloud" width="500" height="400" class="alignnone size-full wp-image-391" /></a></p>
<p>WordPress has got complete guide about how you can create custom tags cloud page template or how you can customize tags cloud at your blog in a number of ways. Give it a try.</p>
<p><a rel="nofollow" target="_blank" href="http://codex.wordpress.org/Template_Tags/wp_tag_cloud" target="_blank"><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/template-tags-resources.jpg" alt="template-tags-resources" title="template-tags-resources" width="500" height="424" class="alignnone size-full wp-image-392" /></a></p>
<p>Have your say! Do you like to customize Tags Cloud at your blog or this is not a necessary part?</p>
<p><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/">Customizing WordPress Tags Cloud &#8211; A Guide</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/" title="How to Include Specific File In WordPress Blog Template">How to Include Specific File In WordPress Blog Template</a></li><li><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/" title="How To Display Some Content at Just Home Page and Single Post of Blog">How To Display Some Content at Just Home Page and Single Post of Blog</a></li><li><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/" title="Display RSS Feed From Any Blog on Your WordPress Blog">Display RSS Feed From Any Blog on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/" title="Provide RSS Feed for Each Post and Comment at Your WordPress Blog">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/" title="Remove Ads for Registered Users or Admin on WordPress Blog">Remove Ads for Registered Users or Admin on WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/lbsd6QSMc8dy1P3oc0syObziO5Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/lbsd6QSMc8dy1P3oc0syObziO5Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/lbsd6QSMc8dy1P3oc0syObziO5Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/lbsd6QSMc8dy1P3oc0syObziO5Y/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/</feedburner:origLink></item>
		<item>
		<title>.htaccess Essential Tricks For Blog/Website Performance – Guide</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/nCk8uZv7czo/</link>
		<comments>http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 20:34:07 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=366</guid>
		<description><![CDATA[
.htaccess file is a magic file. You can change the way your website works by using it. I have been reading a lot about .htaccess files. Perticularly .htaccess is very useful in shared web hosting environment where the users have no direct access to their servers or they want to implement some restrictions/security to their [...]<p><a href="http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/">.htaccess Essential Tricks For Blog/Website Performance &#8211; Guide</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/htaccess-tricks.jpg" alt="htaccess-tricks" title="htaccess-tricks" width="500" height="217" class="alignnone size-full wp-image-370" /></p>
<p>.htaccess file is a magic file. You can change the way your website works by using it. I have been reading a lot about .htaccess files. Perticularly .htaccess is very useful in shared web hosting environment where the users have no direct access to their servers or they want to implement some restrictions/security to their files. I will include here some very essential and useful .htaccess tricks. I have used some of these tricks and more to secure my websites according to my web server&#8217;s environment and to optimize speed/performance of my websites. Websites with heavy traffic, Digg traffic, Stumble upon or slashdot traffic will need to be optimized via many ways and .htaccess can help a lot.</p>
<p><span id="more-366"></span></p>
<h4>Data Compression</h4>
<p>Use this code to compress data at web server. Data compression can minimize resources and bandwidth you consume while your website browsing.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># data compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript</pre></div></div>

<h4>GZip Data Compression</h4>
<p>Following is GZIP Compression code. More effective. You can specify which files to compress.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># gzip compression
&lt;IfModule mod_gzip.c&gt;
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|pl|jpg|png|gif)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
&lt;/IfModule&gt;</pre></div></div>

<h4>Preserve Bandwidth</h4>
<p>Preserve bandwidth using this method. This is also a compression method.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># preserve bandwidth
&lt;ifmodule mod_php4.c&gt;
 php_value zlib.output_compression 16386
&lt;/ifmodule&gt;</pre></div></div>

<h4>Cache Control</h4>
<p>Cache is very very useful. By using following code in .htaccess you can enable cache of your files. When enabling cache you will see significant increase in website load time. You will be really amazed to see heavy pages and images loading very fast.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Begin Cache Control
&lt;IfModule mod_expires.c&gt;
ExpiresActive On
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
&lt;/IfModule&gt;</pre></div></div>

<h4>Secure .htaccess file</h4>
<p>Deny .htaccess file to all intruders. You can specify more files which you want to protect by seperating file names by | sign. .htaccess file can have potential information which must be secured from all outside intruders.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># secure htaccess file
&lt;Files .htaccess&gt;
 order allow,deny
 deny from all
&lt;/Files&gt;</pre></div></div>

<h4>Secure Directories</h4>
<p>By default your web server&#8217;s indexes are on. That means the directory with no index file in it will display all the files in it. Do you want the files in your wp-admin, wp-includes, images, uploads, themes, plugins folders to be seen? It is really not a good idea to show your online folder files. By using following code you will enable protection for all online directories with no index file and will not display files in them.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># No directory listing across domain
Options -Indexes</pre></div></div>

<h4>Secure Hidden Files at Server</h4>
<p>Hidden files can be server configuration files, log files and other server reserved files which should be protected from hackers as well.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Disallow hidden files
RedirectMatch 403 /\..*$</pre></div></div>

<h4>Stop Hotlinking</h4>
<p>Some webmasters will just copy the path of images and other media from your website and use that in their own website to display your content consuming your bandwidth. This method is called as hotlinking. Protect hotlinking by using the following code. sorry.gif in the following example is the alternative file which will be displayed when someone will try and steal your content.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># stop hotlinking and serve alternate content
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourservernamehere.com/
RewriteRule \.(gif|jpg)$ http://www.yourservernamehere.com/sorry.gif [R,L]</pre></div></div>

<h4>Secure Contact Forms</h4>
<p>Secure your contact form from bots and automated softwares which will email you spam. Change &#8216;contact.php&#8217; page name to your contact page name.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># secure contact forms
RewriteCond %{HTTP_REFERER} !^http://www.yourservernamehere.com/.*$ [NC]
RewriteCond %{REQUEST_POST} .*contact.php$
RewriteRule .* - [F]</pre></div></div>

<h4>Redirect Error Pages</h4>
<p>Have you ever encountered 500 error. Internal Server error. That&#8217;s really ugly black and while page. I would suggest you to create your own custom error pages and use them wisely to make users stay at your website even some error occurs. Use the following code to redirect the users to your custom error pages in case some error occurs.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
ErrorDocument 206 http://www.yourservernamehere.com/maintenance-mode.html
ErrorDocument 400 http://www.yourservernamehere.com/maintenance-mode.html
ErrorDocument 408 http://www.yourservernamehere.com/maintenance-mode.html
ErrorDocument 500 http://www.yourservernamehere.com/maintenance-mode.html
ErrorDocument 404 http://www.yourservernamehere.com/404.html
&lt;/IfModule&gt;</pre></div></div>

<h4>Disable ETags</h4>
<p>Disabling Etags will also increase website speed a bit. Removing ETags is a very safe option.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># disable etags
FileETag none</pre></div></div>

<h4>Enable Simple Mod Rewrite</h4>
<p>This is not a performance tip. This is how you enable rewriting at your server. I will write a guide about Mod Rewriting in next .htaccess post.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># enable basic rewriting
RewriteEngine on</pre></div></div>

<h4>Instruct Browser to Download Multimedia Files &#8211; Force Download</h4>
<p>If you want to tell the browser to download certain file types then use the following code.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># instruct browser to download multimedia files
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .wmv
AddType application/octet-stream .mp3</pre></div></div>

<p>In the end let m give you two beautiful resources about .htaccess.</p>
<h4>Best Huge Resources About .htaccess Tricks</h4>
<p><a rel="nofollow" target="_blank" href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/" target="_blank"><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/htaccess-guide.jpg" alt="htaccess-guide" title="htaccess-guide" width="500" height="354" class="alignnone size-full wp-image-379" /></a><br />
<a rel="nofollow" target="_blank" href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/" target="_blank">PerishablePress &#8211; .htaccess Tricks (BEST)</a></p>
<h4>Online .htaccess Editor</h4>
<p>Use this .htaccess editor to select and create rules easily.<br />
<a rel="nofollow" target="_blank" href="http://www.htaccesseditor.com/en.shtml" target="_blank"><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/02/htaccess-editor.jpg" alt="htaccess-editor" title="htaccess-editor" width="500" height="500" class="alignnone size-full wp-image-378" /></a></p>
<h4>More Resources</h4>
<p>Following links will lead you to more detailed resources about .htaccess file customization.<br />
<strong>.htaccess Caching Resources</strong><br />
<a rel="nofollow" target="_blank" href="http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/" target="_blank">How to Optimize Your Site With HTTP Caching</a><br />
<a rel="nofollow" target="_blank" href="http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html" target="_blank">Speed-up Sites With .htaccess Caching</a><br />
<strong>Data Compression</strong><br />
<a rel="nofollow" target="_blank" href="http://viralpatel.net/blogs/2009/02/compress-php-css-js-javascript-optimize-website-performance.html" target="_blank">Compress PHP, CSS, JS &#038; Optimize Website Performance</a><br />
<strong>More Resources</strong><br />
<a rel="nofollow" target="_blank" href="http://corz.org/serv/tricks/htaccess.php" target="_blank">corz.org .htaccess tips</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/KB_/_Unix_/_.htaccess_files" target="_blank">Unix .htaccess Files</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/Category:Htaccess" target="_blank">http://wiki.dreamhost.com/Category:Htaccess</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/Htaccess_tricks" target="_blank">http://wiki.dreamhost.com/Htaccess_tricks</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/Mod_rewrite" target="_blank">http://wiki.dreamhost.com/Mod_rewrite</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/DEFLATE" target="_blank">http://wiki.dreamhost.com/DEFLATE</a><br />
<a rel="nofollow" target="_blank" href="http://wiki.dreamhost.com/More_.htaccess_mod_rewrite_examples" target="_blank">http://wiki.dreamhost.com/More_.htaccess_mod_rewrite_examples</a><br />
<a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Htaccess" target="_blank">http://en.wikipedia.org/wiki/Htaccess</a></p>
<p>I am happy to share .htaccess useful tricks. I had searched much for .htaccess codes to optimize my website performance. My next target for .htaccess is Mod Rewrite. How we can Rewrite URLs. Like blogs do. They can change the URL in a friendly way and display post title rather than http://www.homepagename.com?post=some-digit</p>
<p>Allow me to give you all these codes in ready to use .htaccess file in downloadable form.<br />
Just change &#8216;yourservernamehere&#8217; in the file with your domain name and remove any part which you do not want.</p>
<p><a href='http://www.phpmagicbook.com/wp-content/uploads/2009/02/model-htaccess-file.rar' class="download">Download .htaccess File</a></p>
<p><strong>Happy Coding&#8230;<br />
Happy Valentine&#8217;s Day From PHPMagicBook</strong></p>
<p><a href="http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/">.htaccess Essential Tricks For Blog/Website Performance &#8211; Guide</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/" title="Allow htaccess and Mod Rewrite in Wamp">Allow htaccess and Mod Rewrite in Wamp</a></li><li><a href="http://www.phpmagicbook.com/redirect-wordpress-rss-feeds-to-feedburner/" title="Redirect WordPress RSS Feeds to Feedburner">Redirect WordPress RSS Feeds to Feedburner</a></li><li><a href="http://www.phpmagicbook.com/display-total-number-of-posts-on-your-wordpress-blog/" title="Display Total Number of Posts on Your WordPress Blog">Display Total Number of Posts on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/php-file-upload-script-globals-off/" title="PHP File Upload Script &#8211; Globals Off">PHP File Upload Script &#8211; Globals Off</a></li><li><a href="http://www.phpmagicbook.com/force-file-download-do-not-display-open-in-browser/" title="Force File download Using PHP &#8211; Do Not Display Open In Browser onclick">Force File download Using PHP &#8211; Do Not Display Open In Browser onclick</a></li><li><a href="http://www.phpmagicbook.com/dothtaccess-hacks/" title="Essential DotHtaccess Hacks">Essential DotHtaccess Hacks</a></li><li><a href="http://www.phpmagicbook.com/php-is-not-secure/" title="PHP is Not Secure">PHP is Not Secure</a></li><li><a href="http://www.phpmagicbook.com/protect-php-dot-ini-file-from-being-viewed/" title="Protect php dot ini file from being viewed">Protect php dot ini file from being viewed</a></li><li><a href="http://www.phpmagicbook.com/php-essential-security-fixes-for-your-website/" title="PHP Essential Security Fixes For Your Website">PHP Essential Security Fixes For Your Website</a></li><li><a href="http://www.phpmagicbook.com/text-to-image-using-php/" title="Text To Image Using PHP">Text To Image Using PHP</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/dsQGugcPRi6chr46ydvzT7yqPSY/0/da"><img src="http://feedads.g.doubleclick.net/~a/dsQGugcPRi6chr46ydvzT7yqPSY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dsQGugcPRi6chr46ydvzT7yqPSY/1/da"><img src="http://feedads.g.doubleclick.net/~a/dsQGugcPRi6chr46ydvzT7yqPSY/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/htaccess-essential-tricks-for-blog-website-performance-a-guide/</feedburner:origLink></item>
		<item>
		<title>How to Include Specific File In WordPress Blog Template</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/KLDZ2FEo0GI/</link>
		<comments>http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 23:56:46 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=354</guid>
		<description><![CDATA[Considering the fact that you have some file placed in your current theme folder, you can call it via following code with or without condition. If you plan to call some file right from root folder of your WordPress blog then just remove template path area of code.

With Condition

&#60;?php
if &#40; is_front_page&#40;&#41; &#41; &#123; include &#40;TEMPLATEPATH [...]<p><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/">How to Include Specific File In WordPress Blog Template</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Considering the fact that you have some file placed in your current theme folder, you can call it via following code with or without condition. If you plan to call some file right from root folder of your WordPress blog then just remove template path area of code.</p>
<p><span id="more-354"></span></p>
<h4>With Condition</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_front_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/bio.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
 <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/subscribe.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Include a Specific File Without Condition</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/sidebar2.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Include a Specific File by URL</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.websiteurl.com/some-file.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/">How to Include Specific File In WordPress Blog Template</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/" title="How To Display Some Content at Just Home Page and Single Post of Blog">How To Display Some Content at Just Home Page and Single Post of Blog</a></li><li><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/" title="Display RSS Feed From Any Blog on Your WordPress Blog">Display RSS Feed From Any Blog on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/" title="Provide RSS Feed for Each Post and Comment at Your WordPress Blog">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/" title="Remove Ads for Registered Users or Admin on WordPress Blog">Remove Ads for Registered Users or Admin on WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/2wLKl08ZcU50B2ZNE2TKplYIAfo/0/da"><img src="http://feedads.g.doubleclick.net/~a/2wLKl08ZcU50B2ZNE2TKplYIAfo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/2wLKl08ZcU50B2ZNE2TKplYIAfo/1/da"><img src="http://feedads.g.doubleclick.net/~a/2wLKl08ZcU50B2ZNE2TKplYIAfo/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/</feedburner:origLink></item>
		<item>
		<title>How To Display Some Content at Just Home Page and Single Post of Blog</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/Bxi26b9dMcU/</link>
		<comments>http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 23:40:33 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=352</guid>
		<description><![CDATA[Recently I wanted to display little about section me at my blog but just at home page and single post under sidebar. So how we can tell that we are at home page or at single post in case of WordPress Blog? Here is the code:


&#60;?php if &#40; is_front_page&#40;&#41; or is_home&#40;&#41; or is_single&#40;&#41; &#41; &#123; [...]<p><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/">How To Display Some Content at Just Home Page and Single Post of Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to display little about section me at my blog but just at home page and single post under sidebar. So how we can tell that we are at home page or at single post in case of WordPress Blog? Here is the code:</p>
<p><span id="more-352"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_front_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> or is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> or is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
Your content goes here.
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>is_front_page()</strong> and <strong>is_home()</strong> both will server same purpose.<br />
Put this code anywhere in your blog containing some content in the middle and it should display that content when just single post is viewed or home page of blog is being viewed.</p>
<p><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/">How To Display Some Content at Just Home Page and Single Post of Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/" title="How to Include Specific File In WordPress Blog Template">How to Include Specific File In WordPress Blog Template</a></li><li><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/" title="Display RSS Feed From Any Blog on Your WordPress Blog">Display RSS Feed From Any Blog on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/" title="Provide RSS Feed for Each Post and Comment at Your WordPress Blog">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/" title="Remove Ads for Registered Users or Admin on WordPress Blog">Remove Ads for Registered Users or Admin on WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/bh5tBp76a-UIINqUm9pIp_WXb8o/0/da"><img src="http://feedads.g.doubleclick.net/~a/bh5tBp76a-UIINqUm9pIp_WXb8o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bh5tBp76a-UIINqUm9pIp_WXb8o/1/da"><img src="http://feedads.g.doubleclick.net/~a/bh5tBp76a-UIINqUm9pIp_WXb8o/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/</feedburner:origLink></item>
		<item>
		<title>Display RSS Feed From Any Blog on Your WordPress Blog</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/XhYWUsFwq3I/</link>
		<comments>http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 02:10:54 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=341</guid>
		<description><![CDATA[Ever wanted to display any rss feed from any other blog on your WordPress blog? WordPress have a function, called wp_rss(), which is a built-in rss reader.
Add the following code where you want the rss to be displayed at your blog i.e. sidebar or footer:


&#60;?php include_once&#40;ABSPATH . WPINC . '/rss.php'&#41;;
wp_rss&#40;'http://feeds.feedburner.com/phpmagicbook', 7&#41;; 
?&#62;

We just included the [...]<p><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/">Display RSS Feed From Any Blog on Your WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to display any rss feed from any other blog on your WordPress blog? WordPress have a function, called <strong>wp_rss()</strong>, which is a built-in rss reader.</p>
<p>Add the following code where you want the rss to be displayed at your blog i.e. sidebar or footer:</p>
<p><span id="more-341"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span>ABSPATH <span style="color: #339933;">.</span> WPINC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/rss.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://feeds.feedburner.com/phpmagicbook'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>We just included the <strong>rss.php</strong> file, which is a part of WordPress core.<br />
This file allows us to use the <strong>wp_rss() function</strong>.</p>
<p>wp_rss() function takes two parameters:<br />
The first is the <strong>rss feed url</strong><br />
The second is the <strong>number of rss entries</strong> to be displayed</p>
<p>How simple is that!</p>
<p><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/">Display RSS Feed From Any Blog on Your WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/" title="How to Include Specific File In WordPress Blog Template">How to Include Specific File In WordPress Blog Template</a></li><li><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/" title="How To Display Some Content at Just Home Page and Single Post of Blog">How To Display Some Content at Just Home Page and Single Post of Blog</a></li><li><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/" title="Provide RSS Feed for Each Post and Comment at Your WordPress Blog">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/" title="Remove Ads for Registered Users or Admin on WordPress Blog">Remove Ads for Registered Users or Admin on WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/DciR9tiD6i0Rjt-CoHdp4cPS4pw/0/da"><img src="http://feedads.g.doubleclick.net/~a/DciR9tiD6i0Rjt-CoHdp4cPS4pw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DciR9tiD6i0Rjt-CoHdp4cPS4pw/1/da"><img src="http://feedads.g.doubleclick.net/~a/DciR9tiD6i0Rjt-CoHdp4cPS4pw/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/</feedburner:origLink></item>
		<item>
		<title>Provide RSS Feed for Each Post and Comment at Your WordPress Blog</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/bznVIrRy3Gs/</link>
		<comments>http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 01:48:33 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=337</guid>
		<description><![CDATA[If a post gets lots of comment, it can be hard for your readers to stay on the conversation. WordPress blogging engine have a built-in function for providing rss feed for the comments of a specific post.
Add RSS Feed Link For Comments on Each Post
In order to provide a rss feed for the comments of [...]<p><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If a post gets lots of comment, it can be hard for your readers to stay on the conversation. WordPress blogging engine have a built-in function for providing rss feed for the comments of a specific post.</p>
<p><strong>Add RSS Feed Link For Comments on Each Post</strong></p>
<p>In order to provide a rss feed for the comments of a specific post, you just have to call the <strong>comment_rss_link()</strong> function like below:</p>
<p><span id="more-337"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_rss_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments RSS Feed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You can put this code in WP LOOP to display RSS for post&#8217;s comments from each post right beneath itself.</p>
<p>Similarly we can add a rss link on each post.</p>
<p><strong>Add RSS Link on Each Post</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>?feed=rss&amp;p=<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; target=&quot;_blank&quot;&gt;RSS 2.0&lt;/a&gt;</pre></div></div>

<p>You can put this code in WP LOOP to display RSS from each post right beneath itself.</p>
<p><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/" title="How to Include Specific File In WordPress Blog Template">How to Include Specific File In WordPress Blog Template</a></li><li><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/" title="How To Display Some Content at Just Home Page and Single Post of Blog">How To Display Some Content at Just Home Page and Single Post of Blog</a></li><li><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/" title="Display RSS Feed From Any Blog on Your WordPress Blog">Display RSS Feed From Any Blog on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/" title="Remove Ads for Registered Users or Admin on WordPress Blog">Remove Ads for Registered Users or Admin on WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/JD-RsjYHXZyO3rWeVpSy0lq8jlk/0/da"><img src="http://feedads.g.doubleclick.net/~a/JD-RsjYHXZyO3rWeVpSy0lq8jlk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JD-RsjYHXZyO3rWeVpSy0lq8jlk/1/da"><img src="http://feedads.g.doubleclick.net/~a/JD-RsjYHXZyO3rWeVpSy0lq8jlk/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/</feedburner:origLink></item>
		<item>
		<title>Remove Ads for Registered Users or Admin on WordPress Blog</title>
		<link>http://feedproxy.google.com/~r/phpmagicbook/~3/pZjNooaS9do/</link>
		<comments>http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 01:41:05 +0000</pubDate>
		<dc:creator>King</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[customize]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=335</guid>
		<description><![CDATA[While applying modifications online at your WordPress blog sometimes you have to re-re-refresh the blog to view quick changes. Well! you are running a blog, so you have Adsense or other Ads code too. You do not want to get banned from adevrtising companies. Right?
While you are modifying the code, so you will be logged [...]<p><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/">Remove Ads for Registered Users or Admin on WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>While applying modifications online at your WordPress blog sometimes you have to re-re-refresh the blog to view quick changes. Well! you are running a blog, so you have Adsense or other Ads code too. You do not want to get banned from adevrtising companies. Right?</p>
<p>While you are modifying the code, so you will be logged in. We can hide the code when admin user is still in session or when he is logged in, code will not be displayed.</p>
<p><span id="more-335"></span></p>
<p>We just have to use the <strong>is_user_logged_in()</strong> function, which returns true if an user is logged in.</p>
<p>Just paste the following code anywhere on your theme where you display ads.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>is_user_logged_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Insert Adsense (or whatever) code here</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/">Remove Ads for Registered Users or Admin on WordPress Blog</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/customizing-wordpress-tags-cloud-a-guide/" title="Customizing WordPress Tags Cloud &#8211; A Guide">Customizing WordPress Tags Cloud &#8211; A Guide</a></li><li><a href="http://www.phpmagicbook.com/how-to-include-specific-file-in-wordpress-blog-template/" title="How to Include Specific File In WordPress Blog Template">How to Include Specific File In WordPress Blog Template</a></li><li><a href="http://www.phpmagicbook.com/how-to-display-some-content-at-homepage-single-post-of-blog/" title="How To Display Some Content at Just Home Page and Single Post of Blog">How To Display Some Content at Just Home Page and Single Post of Blog</a></li><li><a href="http://www.phpmagicbook.com/display-rss-feed-from-any-blog-on-your-wordpress-blog/" title="Display RSS Feed From Any Blog on Your WordPress Blog">Display RSS Feed From Any Blog on Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/provide-rss-feed-for-each-post-and-comment-at-your-wordpress-blog/" title="Provide RSS Feed for Each Post and Comment at Your WordPress Blog">Provide RSS Feed for Each Post and Comment at Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/remove-comments-section-from-your-wordpress-blog/" title="Remove Comments Section From Your WordPress Blog">Remove Comments Section From Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/insert-adsense-after-the-first-post-in-your-wordpress-blog/" title="Insert Adsense After the First Post in Your WordPress Blog">Insert Adsense After the First Post in Your WordPress Blog</a></li><li><a href="http://www.phpmagicbook.com/redirect-ugly-permalink-to-postname/" title="Redirect Ugly Permalink to Postname">Redirect Ugly Permalink to Postname</a></li><li><a href="http://www.phpmagicbook.com/optimize-blog-post-title-tag-for-seo/" title="Optimize Blog Post Title Tag For SEO">Optimize Blog Post Title Tag For SEO</a></li><li><a href="http://www.phpmagicbook.com/how-to-get-most-commented-posts-of-the-week-for-your-wordpress-blog/" title="How to Get Most Commented Posts of the Week for your WordPress Blog">How to Get Most Commented Posts of the Week for your WordPress Blog</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/scBk1RqpsAOBXzykXptUajtstoM/0/da"><img src="http://feedads.g.doubleclick.net/~a/scBk1RqpsAOBXzykXptUajtstoM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/scBk1RqpsAOBXzykXptUajtstoM/1/da"><img src="http://feedads.g.doubleclick.net/~a/scBk1RqpsAOBXzykXptUajtstoM/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.phpmagicbook.com/remove-ads-for-registered-users-or-admin-on-wordpress-blog/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 6.482 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-11-12 03:45:11 --><!-- Compression = gzip -->
