<?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>Build Me A Fab Website &#187; Wordpress Hacks</title>
	<atom:link href="http://www.buildmeafabwebsite.co.uk/tag/wordpress-hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.buildmeafabwebsite.co.uk</link>
	<description>Friendly, Low Cost Web Design &#38; Hosting</description>
	<lastBuildDate>Mon, 16 Jan 2012 20:03:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WordPress How to : Style comments of every roles</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 15:44:08 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=1671</guid>
		<description><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>To do so, simply open your <em>comments.php</em> file and replace your comments loop by this one :</p>
<pre>&#60;ol id="commentlist"&#62;
&#60;?php foreach ($comments as $comment) : ?&#62;
	&#60;?php</pre><p>&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/">WordPress How to : Style comments of every roles</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>To do so, simply open your <em>comments.php</em> file and replace your comments loop by this one :</p>
<pre>&lt;ol id="commentlist"&gt;
&lt;?php foreach ($comments as $comment) : ?&gt;
	&lt;?php // The extra stuff to get commenter's role
	$user_id = $comment-&gt;user_id;
	$role = ( isset( $roles[$user_id] )
        ? $roles[$user_id] : '' );
	?&gt;
	&lt;li class="&lt;?php echo $role; ?&gt;"&gt;
	&lt;p&gt;By &lt;?php comment_author_link() ?&gt; -
        &lt;?php comment_date() ?&gt;&lt;/p&gt;
	&lt;?php comment_text() ?&gt;
	&lt;/li&gt;
&lt;?php endforeach; ?&gt;
&lt;/ol&gt;</pre>
<p>Once done, open yout <em>style.css</em> file and paste the following:</p>
<pre>#commentlist li { border:2px solid white; }
/* not logged or subscriber */
#commentlist li.administrator { border:2px solid red }
/* blog admin */
#commentlist li.editor { border:2px solid blue }
/* editor */</pre>
<p><strong><em>Many thanks to <a href="http://planetozh.com/blog/2009/11/how-to-style-editor-or-any-role-comments-in-wordpress">Ozh</a> for this very interesting code!</em></strong><em><br />
<a href="http://www.wprecipes.com/wordpress-how-to-style-comments-of-every-roles">WordPress How to : Style comments of every roles</a></em></p>
<p><em><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/7894e_EBTnrpWcCvs" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></em><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/display-most-recent-comments-with-gravatar/" rel="bookmark" title="January 25, 2010">Display most recent comments with Gravatar</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/web-design-articles/here%e2%80%99s-something-interesting-about-css-borders/" rel="bookmark" title="April 26, 2011">Here’s Something Interesting About CSS Borders</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-build-a-top-sliding-login-panel/" rel="bookmark" title="December 22, 2009">How to Build a Top Sliding Login Panel</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/add-a-facebook-%e2%80%9clike%e2%80%9d-button-to-your-wordpress-blog/" rel="bookmark" title="September 18, 2010">Add a Facebook “Like” button to your WordPress blog</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/" rel="bookmark" title="January 18, 2010">How to disable image caption in WordPress post editor</a></li>
</ul>
<p><!-- Similar Posts took 32.815 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/">WordPress How to : Style comments of every roles</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why All-In-One SEO Deactivates</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/why-all-in-one-seo%c2%a0deactivates/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/why-all-in-one-seo%c2%a0deactivates/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:20:07 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>
		<category><![CDATA[Wordpress Tip]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=2656</guid>
		<description><![CDATA[<p>In the past I’ve been pretty pissy about the <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All-In-One SEO plugin</a> from <a href="http://michaeltorbert.com/">Michael Torbert</a> automatically deactivating itself after updates. My reasoning:</p>
<ul>
<li>If you update and forget to re-activate (somewhat hard to do since it reminds the</li></ul><p>&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/why-all-in-one-seo%c2%a0deactivates/">Why All-In-One SEO Deactivates</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In the past I’ve been pretty pissy about the <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All-In-One SEO plugin</a> from <a href="http://michaeltorbert.com/">Michael Torbert</a> automatically deactivating itself after updates. My reasoning:</p>
<ul>
<li>If you update and forget to re-activate (somewhat hard to do since it reminds the shit out of you on every page of the admin), it could cause problems.</li>
<li>We are forced to see Michael’s large promotional/donation blocks up in our faces above where we can reactivate. I’m all for plugin authors making as much money as they can, but this seemed to me a bit too far.</li>
<li>I really like the plugin and use it on all my sites and wish it was closer to my version of perfect.</li>
</ul>
<p>But Michael recently stopped by to explain his side, which is interesting, so I thought I’d update the record, as it were.</p>
<p><span> </span></p>
<p><a href="http://digwp.com/2009/10/rude-things-plugins-can-do/#comment-3005">Michael Torbert</a>:</p>
<blockquote><p>… a site complained that a new feature damaged their site’s search engine results placement. They finally admitted that they were incorrect in this assumption, and that the cause was something else unrelated to the plugin, but their original assessment was that a new feature hurt them.</p>
<p>From then on, any update which introduces new options (not just behind the scenes changes) require the user to reactivate the plugin from the settings page, to make sure that they can review the options.</p></blockquote>
<p>I can understand this line of thinking. Forcing the user to visit the options page may be the closest thing to getting them to think about the plugins options as is possible.</p>
<p>Michael is also aware of the potentially negative experience:</p>
<blockquote><p>I’m aware of how it looks, and I understand that it’s annoying for some users. I spent a lot of time thinking about it and consulted with a number of other people in the community when contemplating the decision about what to do.<br />
Unfortunately, in this case there was no way to make everyone happy, so I sided with ensuring that nobody could ever say (even if incorrectly as was the case) that new features introduced caused harmful effects to their sites SEO.</p></blockquote>
<h3>Perhaps a better way?</h3>
<p>Let’s say that the moment you decided to upgrade the plugin to a version with new features, the google bot decided to stroll by your site. The plugin is momentarily deactivated, so the google bot sees lots of differences. The canonical tag is gone, the meta tags are gone, the page title is different. Surely that isn’t good for SEO.</p>
<p>Perhaps this plugin could save the currently running version number in the wp_options table. Then when an upgrade is performed, it could update this but also save the <strong>previous</strong> version number. Then instead of deactivating itself, it could display a message (rather boldly, like the current message) which explains what is new with the plugin and things you should watch for.</p>
<p><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/717ce_hPHJ3HISlZU" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://digwp.com" target="_blank">Digging Into WordPress</a><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-show-an-urgent-message-in-the-wordpress-admin-area/" rel="bookmark" title="July 20, 2011">How to show an urgent message in the WordPress admin area</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/what-to-do-when-auto-update%c2%a0fails-2/" rel="bookmark" title="April 19, 2011">What to do when Auto-Update Fails</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/free-wordpress-themes/postage-sydney/" rel="bookmark" title="July 22, 2010">Postage Sydney</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-plugin-protect-your-blog-from-malicious-url-requests/" rel="bookmark" title="March 17, 2010">WordPress plugin: Protect your blog from malicious URL Requests</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-plugins/15-anti-spam-plugins-for%c2%a0wordpress/" rel="bookmark" title="June 15, 2011">15 Anti-Spam Plugins for WordPress</a></li>
</ul>
<p><!-- Similar Posts took 30.086 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/why-all-in-one-seo%c2%a0deactivates/">Why All-In-One SEO Deactivates</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/why-all-in-one-seo%c2%a0deactivates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable image caption in WordPress post editor</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 12:21:06 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=2618</guid>
		<description><![CDATA[<p>Simply paste the following lines of code in your <em>functions.php</em> file, and you&#8217;re done!</p>
<pre>function caption_off() {
    return true;
}

add_filter( 'disable_captions', 'caption_off' );</pre>
<p><strong><em>Thanks to <a href="http://www.wp-tricks.co.il/%D7%94%D7%A1%D7%A8%D7%94-%D7%90%D7%95%D7%98%D7%95%D7%9E%D7%98%D7%99%D7%AA-%D7%A9%D7%9C-%D7%9E%D7%A1%D7%92%D7%A8%D7%95%D7%AA-%D7%9B%D7%99%D7%AA%D7%95%D7%91-%D7%94%D7%AA%D7%9E%D7%95%D7%A0%D7%94/">Wp Tricks</a> for this nice hack!</em></strong></p>
<p><em></em></p>
<p><em><a href="http://www.wprecipes.com/how-to-disable-image-caption-in-wordpress-post-editor">How to disable image caption in</a></em>&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/">How to disable image caption in WordPress post editor</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following lines of code in your <em>functions.php</em> file, and you&#8217;re done!</p>
<pre>function caption_off() {
    return true;
}

add_filter( 'disable_captions', 'caption_off' );</pre>
<p><strong><em>Thanks to <a href="http://www.wp-tricks.co.il/%D7%94%D7%A1%D7%A8%D7%94-%D7%90%D7%95%D7%98%D7%95%D7%9E%D7%98%D7%99%D7%AA-%D7%A9%D7%9C-%D7%9E%D7%A1%D7%92%D7%A8%D7%95%D7%AA-%D7%9B%D7%99%D7%AA%D7%95%D7%91-%D7%94%D7%AA%D7%9E%D7%95%D7%A0%D7%94/">Wp Tricks</a> for this nice hack!</em></strong></p>
<p><em></em></p>
<p><em><a href="http://www.wprecipes.com/how-to-disable-image-caption-in-wordpress-post-editor">How to disable image caption in WordPress post editor</a></em></p>
<p><em><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/89dfc_22OQBY65afY" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></em><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/display-the-number-of-tweets-for-each-page-or-post/" rel="bookmark" title="December 10, 2009">Display the number of tweets for each page or post</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/admin-bar%c2%a0tricks/" rel="bookmark" title="July 21, 2011">Admin Bar Tricks</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-remove-%e2%80%9cprivate%e2%80%9d-and-%e2%80%9cprotected%e2%80%9d-from-the-post-title/" rel="bookmark" title="February 25, 2010">How to remove “private” and “protected” from the post title</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/" rel="bookmark" title="December 24, 2009">WordPress hack : How to display ads on old posts only</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/" rel="bookmark" title="December 31, 2009">How to Define Your Own Dashboard Logo</a></li>
</ul>
<p><!-- Similar Posts took 27.581 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/">How to disable image caption in WordPress post editor</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-disable-image-caption-in-wordpress-post-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Define Your Own Dashboard Logo</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 12:42:27 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>
		<category><![CDATA[Wordpress Tip]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=2102</guid>
		<description><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>The first thing to do is to get your logo ready. Size might be 30*31px and the logo must be uploaded the images directory of your theme&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/">How to Define Your Own Dashboard Logo</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>The first thing to do is to get your logo ready. Size might be 30*31px and the logo must be uploaded the images directory of your theme dir.<br />
For exemple, if you&#8217;re using the rockstar theme from <a href="http://www.wprecipes.com/freshnews.html" target="blank">WooThemes</a>, your logo must be uploaded to <em>wp-content/themes/rockstar/images</em>.</p>
<p>Once done, open you <em>functions.php</em> file and paste the following code in it:</p>
<pre>add_action('admin_head', 'my_custom_logo');

function my_custom_logo() {
   echo '
      &lt;style type="text/css"&gt;
         #header-logo {
          background-image:
          url('.get_bloginfo('template_directory').'
          /images/custom-logo.gif)
          !important; }
      &lt;/style&gt;
   ';
}</pre>
<p><strong><em>Thanks to <a href="http://www.smashingmagazine.com/2009/12/14/advanced-power-tips-for-wordpress-template-developers-reloaded/">Smashing Magazine</a> for this great hack!</em></strong></p>
<p><em> </em></p>
<p><em><a href="http://www.wprecipes.com/how-toi-define-your-own-dashboard-logo">How to define your own dashboard logo</a></em></p>
<p><em><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/461ef_-2zqaKmsZEg" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></em><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-detect-mobile-visitors-on-your-wordpress-blog/" rel="bookmark" title="December 28, 2009">How to detect mobile visitors on your WordPress blog</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/specify-unique-css-file-per%c2%a0post/" rel="bookmark" title="May 31, 2010">Specify Unique CSS File Per Post</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/custom-page-titles-from%c2%a0scratch/" rel="bookmark" title="June 16, 2010">Custom Page Titles from Scratch</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-tip-send-article-to-a-friend-by-email/" rel="bookmark" title="December 24, 2009">WordPress tip: Send article to a friend by email</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/free-wordpress-themes/postage-sydney/" rel="bookmark" title="July 22, 2010">Postage Sydney</a></li>
</ul>
<p><!-- Similar Posts took 31.495 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/">How to Define Your Own Dashboard Logo</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-define-your-own-dashboard-logo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 More WordPress Hacks for Easy Life</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 10:20:27 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=2110</guid>
		<description><![CDATA[<h3>1. Fight Cross Browser Compatibility the WordPress Way</h3>
<p>While designing a theme, there are numerous cross browser compatibility issues that raise their head, and most of the times we are left with no choice but revert to using conditional hacks.&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/">10 More WordPress Hacks for Easy Life</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<h3>1. Fight Cross Browser Compatibility the WordPress Way</h3>
<p>While designing a theme, there are numerous cross browser compatibility issues that raise their head, and most of the times we are left with no choice but revert to using conditional hacks. The following WordPress hacks can really save a lot of headache :-</p>
<p>Open your <em>functions.php</em> file in the theme folder and add the following code :-</p>
<pre>&lt;?php
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
 global $is_lynx, $is_gecko, $is_IE,
$is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;

 if($is_lynx) $classes[] = 'lynx';
 elseif($is_gecko) $classes[] = 'gecko';
 elseif($is_opera) $classes[] = 'opera';
 elseif($is_NS4) $classes[] = 'ns4';
 elseif($is_safari) $classes[] = 'safari';
 elseif($is_chrome) $classes[] = 'chrome';
 elseif($is_IE) $classes[] = 'ie';
 else $classes[] = 'unknown';

 if($is_iphone) $classes[] = 'iphone';
 return $classes;
}
?&gt;</pre>
<p>The above function adds the name of the browser (e.g, opera, safari etc.) to your  tag like this :-</p>
<pre>&lt;body class="home blog logged-in safari"&gt;</pre>
<p>Now you being a theme designer can take help of this custom class and write your CSS accordingly if you are facing any compatibility issues with any browser. This can be called as “<strong>planning in advance</strong>“!</p>
<h3>2. Schedule an Event using WordPress</h3>
<p>Many of us already know that posts on a WordPress blog can be scheduled to be posted on future dates. But did you know that this alarm kind of function can be used for different other things too! Here is a practicle usage that lets your WordPress blog shoot out an e-mail to you every hour (A very handy function in case you want to know the uptime of your website – Just make a folder in your e-mail for such e-mails and read them later as log details). Add the following code into the <em>functions.php</em> file of your theme.</p>
<pre>if (!wp_next_scheduled('my_task_hook')) {
	wp_schedule_event( time(), 'hourly', 'my_task_hook' );
}
add_action( 'my_task_hook', 'my_task_function' ); 

function my_task_function() {
	wp_mail('you@yoursite.com', 'Automatic email',
'Hello, this is an automatically scheduled email from WordPress.');
}</pre>
<p>You can define your e-mail and subject in the above code yourself.</p>
<h3>3. Removing Unwanted Links from your Comments</h3>
<p>Here is a neat function that lets you remove unwanted links from your comments. As before, place the following code in the <em>functions.php</em> file of the theme folder :-</p>
<pre>function plc_comment_post( $incoming_comment ) {
	$incoming_comment['comment_content'] =
        htmlspecialchars($incoming_comment['comment_content']);
	$incoming_comment['comment_content'] =
        str_replace( "'", '&amp;apos;',
        $incoming_comment['comment_content'] );
	return( $incoming_comment );
}

function plc_comment_display( $comment_to_display ) {
	$comment_to_display =
        str_replace( '&amp;apos;', "'", $comment_to_display );
	return $comment_to_display;
}

add_filter('preprocess_comment', 'plc_comment_post', '', 1);
add_filter('comment_text', 'plc_comment_display', '', 1);
add_filter('comment_text_rss', 'plc_comment_display', '', 1);
add_filter('comment_excerpt', 'plc_comment_display', '', 1);</pre>
<p>Spammers Die! Yay!</p>
<h3>4. Retrieving Posts within a Date Range</h3>
<p>Sometimes you will need to pull posts between two specific dates from your blog. The code below allows you to do just that :-</p>
<pre>&lt;?php
  function filter_where($where = '') {
        $where .= " AND post_date &gt;= '2009-03-17'
        AND post_date &lt;= '2009-05-03'";
    return $where;
  }
add_filter('posts_where', 'filter_where');
query_posts($query_string);
while (have_posts()) :
      the_post();
      the_content();
endwhile;

?&gt;</pre>
<p>You can copy and paste the above code anywhere within your template files. Just don’t forget to change the dates.</p>
<h3>5. Using Multiple Loops without Duplication</h3>
<p>If you need to break display your posts in different sections (like in Magazine themes), where you want to display a fixed number of posts first, and the remaining later, you can use this code to make multiple loops (with offsetting the fixed posts in the later loop).</p>
<p>The first loop that will pull and display 5 recent posts :-</p>
<pre>&lt;?php
query_posts('showposts=5');
$ids = array();
while (have_posts()) : the_post();
$ids[] = get_the_ID();
the_title();
the_content();
endwhile;
?&gt;</pre>
<p>And, the second loop that will exclude the above posts and show the remaining ones :-</p>
<pre>&lt;?php
query_posts(array('post__not_in' =&gt; $ids));
while (have_posts()) : the_post();
the_title();
the_content();
endwhile;
?&gt;</pre>
<p>This code basically pulls the post IDs that are not contained in the array $ids[].</p>
<h3>6. Highlighting Searched Keywords in Search Results</h3>
<p>If you need to highlight the searched text in your search results (which is not an option by default in WordPress), here is the solution that accomplishes this feat :-</p>
<ul>
<li>Open up your <em>search.php</em> file from the theme folder.</li>
<li>Find the_title() function and replace it with :-
<pre>mytitle();</pre>
</li>
<li>Add this code to your functions.php file
<pre>&lt;?php
function mytitle() {
	$mytitle = get_the_title();
	$keys= explode(" ",$s);
$mytitle =preg_replace('/('.implode('|', $keys) .')/iu',</pre>
<pre>		'&lt;span class="searched"&gt;\0&lt;/span&gt;',
		$mytitle);
        echo $mytitle;
}
?&gt;</pre>
</li>
<li>Open style.css file and add the following code:-
<pre>.searched { background: yellow; font-weight:bold; }</pre>
</li>
</ul>
<p>We are done. Try searching some text on your blog now!</p>
<h3>7. Display Related Posts without a Plugin</h3>
<p>This is a good hack if you want to show “related posts” below the single post view on your blog without the use of a plugin. Just open the <em>single.php</em> file and paste the following code within the WordPress loop :-</p>
<pre>&lt;?php
//for use in the loop, list 5 post titles
related to first tag on current post
$backup = $post;  // backup the current object
$tags = wp_get_post_tags($post-&gt;ID);
echo "&lt;div&gt;&lt;h3&gt;Related Posts&lt;/h3&gt;";
	$tagIDs = array();
	if ($tags)
	{
		$tagcount = count($tags);
			for ($i = 0; $i &lt; $tagcount; $i++) {
			$tagIDs[$i] = $tags[$i]-&gt;term_id;
			}
			$args=array(
			'tag__in' =&gt; $tagIDs,
			'post__not_in' =&gt; array($post-&gt;ID),
			'showposts'=&gt;5,
			'caller_get_posts'=&gt;1
			);
			$my_query = new WP_Query($args);
			if( $my_query-&gt;have_posts() )
			{
			echo "&lt;ul&gt;";
			while ($my_query-&gt;have_posts()) :
                        $my_query-&gt;the_post(); ?&gt;
			&lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"
                        rel="bookmark"
                        title="&lt;?php the_title(); ?&gt;"&gt;
                        &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;?php endwhile;
			echo "&lt;/ul&gt;";
			}
	} else echo "&lt;span&gt;No related posts were found!&lt;/span&gt;";
	$post = $backup;  // copy it back
	wp_reset_query(); // to use the original query again
echo "&lt;/div&gt;";
?&gt;</pre>
<p>The above code uses post “Tags” (that you have made in your posts) to relate the posts. So use them wisely!</p>
<h3>8. Add your Posts to Facebook</h3>
<p>The following hack will add a link within your posts that will allow users to share the post with their friends on <a href="http://www.facebook.com">Facebook</a>. This can help in bringing extra traffic to your blog. Open the <em>single.php</em> file from your theme folder and paste this code within the loop where you want the link to show up :-</p>
<pre>&lt;a href="http://www.facebook.com/sharer.php?u=
&lt;?php the_permalink();?&gt;&amp;t=&lt;?php the_title(); ?&gt;"
target="blank"&gt;Share on Facebook&lt;/a&gt;</pre>
<p>Now the users will be able to share your posts!</p>
<h3>9. Inserting Advertisements after Every First Post</h3>
<p>Open up your <em>index.php</em> file and find the loop. Replace your loop with the following :-</p>
<pre>&lt;?php if (have_posts()) : ?&gt;
&lt;?php $count = 0; ?&gt;
&lt;?php while (have_posts()) : the_post(); ?&gt;
&lt;?php $count++; ?&gt;
  &lt;?php if ($count == 2) : ?&gt;
          //Paste your ad code here
          &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;
          &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
          &lt;?php the_excerpt(); ?&gt;
   &lt;?php else : ?&gt;
          &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;
          &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
          &lt;?php the_excerpt(); ?&gt;
  &lt;?php endif; ?&gt;
&lt;?php endwhile; ?&gt;
&lt;?php endif; ?&gt;</pre>
<p>You can paste your ad code where it says “//Paste your ad code here”. Your loop might not be exactly replaceable so you can take hints from the above code and modify your loop accordingly.</p>
<h3>10. Automatic Content after Each Post</h3>
<p>Many times, you want to add custom content/text after every post (e.g, subscribe to our blog link). Open up your <em>functions.php</em> file and add the following code to it :-</p>
<pre>function insertFootNote($content) {
        if(!is_feed() &amp;&amp; !is_home()) {
                $content.= "&lt;div class='subscribe'&gt;";
                $content.= "&lt;h4&gt;Enjoyed this article?&lt;/h4&gt;";
                $content.= "&lt;p&gt;Subscribe to our
                &lt;a href='http://feeds2.feedburner.com/WpRecipes'&gt;
                RSS feed&lt;/a&gt; and never miss a recipe!&lt;/p&gt;";
                $content.= "&lt;/div&gt;";
        }
        return $content;
}
add_filter ('the_content', 'insertFootNote');</pre>
<p>I hope you enjoyed the above hacks and will make use of them. Please comment and let me know.</p>
<p><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/d1e38_ykqpSO1oOzw" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.blogohblog.com/" target="_blank">Blog Oh Blog</a><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/display-most-recent-comments-with-gravatar/" rel="bookmark" title="January 25, 2010">Display most recent comments with Gravatar</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-remove-admin-name-in-comments-class/" rel="bookmark" title="June 1, 2010">WordPress hack: Remove admin name in comments class</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/nextprevious-post-navigation-outside-of-the-wordpress%c2%a0loop/" rel="bookmark" title="July 26, 2010">Next/Previous Post Navigation Outside of the WordPress Loop</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/randomized-grid-of%c2%a0posts/" rel="bookmark" title="November 1, 2010">Randomized Grid of Posts</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-how-to-style-comments-of-every-roles/" rel="bookmark" title="January 28, 2010">WordPress How to : Style comments of every roles</a></li>
</ul>
<p><!-- Similar Posts took 25.508 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/">10 More WordPress Hacks for Easy Life</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress hack : How to display ads on old posts only</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 16:21:55 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=1674</guid>
		<description><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>To achieve this recipe, simply open your <em>functions.php</em> file and paste the following code in it:</p>
<pre>function is_old_post($post_id=null){
   $days = 15;
   global $wp_query;
   if(is_single() &#124;&#124; is_page()) {</pre><p>&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/">WordPress hack : How to display ads on old posts only</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>To achieve this recipe, simply open your <em>functions.php</em> file and paste the following code in it:</p>
<pre>function is_old_post($post_id=null){
   $days = 15;
   global $wp_query;
   if(is_single() || is_page()) {
      if(!$post_id) {
         $post_id = $wp_query-&gt;post-&gt;ID;
      }
      $current_date = time();
      $offset = $days *60*60*24;
      $post_id = get_post($post_id);
      $post_date = mysql2date('U',$post_id-&gt;post_date);
      $cunning_math = $post_date + $offset;
      $test = $current_date - $cunning_math;
      if($test &gt; 0){
         $return = true;
      }else{
         $return = false;
      }
   }else{
      $return = false;
   }
   return $return;
}</pre>
<p>Once done, you are now ready to call the functions in your <em>single.php</em> template as shown below:</p>
<pre>&lt;?php if(is_old_post()){ ?&gt;
INSERT AD CODE HERE
&lt;?php } ?&gt;</pre>
<p>That&#8217;s all, you&#8217;re done. By default, ads will be displayed on post older than 15 days. To change this value, simply edit the <em>$days</em> variable on line 2.</p>
<p><em><a href="http://www.wprecipes.com/wordpress-hack-how-to-display-ads-on-old-posts-only">WordPress hack : How to display ads on old posts only</a></em></p>
<p><em><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/7894e_SuojXumEAtg" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></em><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-tip-change-excerpt-length-depending-of-the-category/" rel="bookmark" title="December 10, 2009">WordPress tip : change excerpt length depending of the category</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-display-your-average-feed-readers/" rel="bookmark" title="September 1, 2010">How to display your average feed readers</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/" rel="bookmark" title="December 10, 2009">WordPress hack : Automatically output the content in two columns</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-tip-insert-custom-content-after-each-post/" rel="bookmark" title="August 3, 2010">WordPress tip: Insert custom content after each post</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-modify-lists-like-%e2%80%98categories%e2%80%99-and-%e2%80%98blogroll%e2%80%99-in-wordpress/" rel="bookmark" title="December 10, 2009">How to modify lists like ‘Categories’ and ‘Blogroll’ in WordPress?</a></li>
</ul>
<p><!-- Similar Posts took 28.415 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/">WordPress hack : How to display ads on old posts only</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-how-to-display-ads-on-old-posts-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress hack : Automatically output the content in two columns</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 21:04:18 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=1668</guid>
		<description><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>This code is poweful but definitely easy to implement. Just paste it on your <em>functions.php</em> file and it will automatically output your post content in columns.<br />&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/">WordPress hack : Automatically output the content in two columns</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></p>
<p>This code is poweful but definitely easy to implement. Just paste it on your <em>functions.php</em> file and it will automatically output your post content in columns.<br />
Your post content will be splitted on <em>&lt;h2&gt;</em> tags.</p>
<pre>function my_multi_col($content){
$columns = explode('&lt;h2&gt;', $content);

$i = 0;

	foreach ($columns as $column){
	if (($i % 2) == 0){
		$return .= '&lt;div class="content_left"&gt;' . "\n";
		if ($i &gt; 1){
		$return .= "&lt;h2&gt;";
	} else{
		$return .= '&lt;div class="content_right"&gt;' . "\n &lt;h2&gt;";
	}
		$return .= $column;
		$return .= '&lt;/p&gt;&lt;/div&gt;';
		$i++;
	}

	if(isset($columns[1])){
	    $content = wpautop($return);
	}else{
	    $content = wpautop($content);
	}
	echo $content;
}
}
add_filter('the_content', 'my_multi_col');</pre>
<p>Don&#8217;t forget to add the following styles to your <em>style.css</em> file :</p>
<pre>.content_right, .content_left{
    float:left;
    width:45%;
}

.content_left{
    padding-right:5%;
}</pre>
<p><strong><em>Thanks to <a href="http://www.kriesi.at/archives/wordpress-display-content-in-multiple-columns">www.kriesi.at</a> for contributing this great function to the community!</em></strong></p>
<p><em><a href="http://www.wprecipes.com/wordpress-hack-automatically-output-the-content-in-two-columns">WordPress hack : Automatically output the content in two columns</a></em></p>
<p><em><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/7894e_8MufVmcqO3c" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.wprecipes.com" target="_blank">WP Recipes</a></em><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-use-includes-in-your-posts-or-pages/" rel="bookmark" title="July 17, 2010">WordPress hack: Use includes in your posts or pages</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-remove-admin-name-in-comments-class/" rel="bookmark" title="June 1, 2010">WordPress hack: Remove admin name in comments class</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-tip-create-a-pdf-viewer-shortcode/" rel="bookmark" title="March 21, 2010">WordPress tip: Create a PDF viewer shortcode</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/add-private-content-to-posts-via%c2%a0shortcode/" rel="bookmark" title="May 6, 2010">Add Private Content to Posts via Shortcode</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/" rel="bookmark" title="December 10, 2009">22 Latest Exceptional WordPress Hacks</a></li>
</ul>
<p><!-- Similar Posts took 25.391 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/">WordPress hack : Automatically output the content in two columns</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-automatically-output-the-content-in-two-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>22 Latest Exceptional WordPress Hacks</title>
		<link>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/</link>
		<comments>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 20:32:26 +0000</pubDate>
		<dc:creator>RSSFeed</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>

		<guid isPermaLink="false">http://www.buildmeafabwebsite.co.uk/?p=1694</guid>
		<description><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.instantshift.com/" target="_blank">Instant Shift</a></p>
<p><strong>WordPress</strong> needs no introduction among designers and writers. It’s usually known as a synonym for blogging. Now days every other WordPress blogs look more or less similar,&#8230;</p><p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/">22 Latest Exceptional WordPress Hacks</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post was generated by an RSS Feed from <a href="http://www.instantshift.com/" target="_blank">Instant Shift</a></p>
<p><strong>WordPress</strong> needs no introduction among designers and writers. It’s usually known as a synonym for blogging. Now days every other WordPress blogs look more or less similar, to stand uniquely out from the rest, you need to tweak it a little bit by using quality hacks.</p>
<p>As you all known that the new version <strong>v2.8</strong> is arrived and most of you already updated your WordPress to v2.8. So, now there is a need of new working hacks which is compatible with latest version.</p>
<p>Of Course, <a rel="external nofollow" href="http://codex.wordpress.org/" target="_blank"><strong>WordPress Codex</strong></a> is always the best place to learn about WordPress and its tweaks. But unfortunately, it’s too much for a simple WordPress user. This the only reason we compiled this fairly comprehensive list of the <strong> Exceptional WordPress Hacks</strong> to unleash the power of your favorite blogging engine.<br />
<span> </span></p>
<p>One of the greatest things about blogging is the immediate feedback a blogger can get from his or her readers. Still it’s often possible that your readers don’t give you a wink about their likes and dislikes. Unfortunately, there is no way for you to find out about visitors thinking towards your blog or its design. It’s always essential to play safe and give others what they like. Out of many solutions the inspirational one is only promising and optimistic way to achieve desired changes. This article focuses on organized collection of some of the <strong>Most Wanted WordPress Hacks</strong> which will definitely make your blogging life easier.</p>
<div>
<h1><span>General WordPress Related Hacks</span></h1>
<div>
<h4><span>01. <span style="text-decoration: underline;">How to Speed Up Your Blog’s Loading Speed</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/4e3a6_lewh-01.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>WordPress, by default, comes uncompressed and sends the uncompressed HTML to the visitor’s browser. With one line of code added to your header, you can compress WordPress’s output by up to 75%. By using zlib compression technology, you can harness the power of PHP and reduce your blog’s load time and increase the load speed!</p>
<p>First, place the following code in a file and call it <em>“test.php”</em> and then upload it to the root of your blog directory:</p>
<pre>&lt;?php phpinfo(); ?&gt;</pre>
<p>Make sure that “zlib” is enabled by your hosting provider.</p>
<p>Second, place the following code in your header (above the DOCTYPE):</p>
<pre>&lt;?php
  ini_set('zlib.output_compression', 'On');
  ini_set('zlib.output_compression_level', '1');
?&gt;</pre>
<p>You’re done! Check <a rel="external nofollow" href="http://port80software.com" target="_blank">Port80Software.com</a> to ensure you are compressing your output.</p>
<p><a rel="external nofollow" href="http://www.wprecipes.com/compress-wordpress-output-and-speed-your-blogs-load-speed" target="_blank">Source Link</a></p>
<h4><span>02. <span style="text-decoration: underline;">Allow More Time For Slow Servers to Upgrade WordPress</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/4e3a6_lewh-02.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>WordPress auto download/install is a very nice feature, but sometimes a few problems can appear. One of them is that WordPress don’t manage to download the new version. This happens on slow servers. Here is how to solve it.</p>
<p>To apply this hack, you’ll have to edit one of WordPress core files. Keep in mind that it is never recommended. This hack should be applied only if you have problems while auto-upgrading WordPress.</p>
<p>Open the <em>wp-admin/includes/files.php</em> file and go to line 448. You’ll see the following:</p>
<pre>$response = wp_remote_get($url, array('timeout' =&gt; 60));</pre>
<p>To allow more downloading time, simply change the 60 with a greater value, as for example:</p>
<pre>$response = wp_remote_get($url, array('timeout' =&gt; 120));</pre>
<p>it’s all done!!</p>
<p><a rel="external nofollow" href="http://www.wprecipes.com/wordpress-upgrade-allow-more-time-for-slow-servers" target="_blank">Source Link</a></div>
<h1><span>Pages Related Hacks</span></h1>
<div>
<h4><span>03. <span style="text-decoration: underline;">How to Get All Custom Fields From a Page or a Post</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/9f092_lewh-03.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Sometimes you may need to get all custom fields from a specific post or page. Apply following function that do the job.</p>
<pre>function all_my_customs($id = 0){
  //if we want to run this function on a page of our choosing them the next section is skipped.
  //if not it grabs the ID of the current page and uses it from now on.
  if ($id == 0) :
    global $wp_query;
    $content_array = $wp_query-&gt;get_queried_object();
    $id = $content_array-&gt;ID;
  endif;   

  //knocks the first 3 elements off the array as they are WP entries and i dont want them.
  $first_array = array_slice(get_post_custom_keys($id), 3);

  //first loop puts everything into an array, but its badly composed
  foreach ($first_array as $key =&gt; $value) :
    $second_array[$value] =  get_post_meta($id, $value, FALSE);

    //so the second loop puts the data into a associative array
    foreach($second_array as $second_key =&gt; $second_value) :
      $result[$second_key] = $second_value[0];
    endforeach;
  endforeach;

  //and returns the array.
  return $result;
}</pre>
<p>Once done, you can use the function like this:</p>
<pre>$result = all_my_customs();
echo $result['my_meta_key'];</pre>
<p><a rel="external nofollow" href="http://www.wprecipes.com/wordpress-tip-get-all-custom-fields-from-a-page-or-a-post" target="_blank">Source Link</a></p>
<h4><span>04. <span style="text-decoration: underline;">How to Show Parent Page Title Regardless of What Subpage You Are On</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/32455_lewh-04.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>This hack is useful for peoples who working with WordPress as a CMS and wanting to be easily able to display parent page title on a subpage.</p>
<p>Nothing hard at all: Just paste the following code where you’d like to display the parent page title:</p>
<pre>&lt;?php
if($post-&gt;post_parent) {
  $parent_title = get_the_title($post-&gt;post_parent);
  echo $parent_title;
} else {
  wp_title('');
}
?&gt;</pre>
<p>That’s all! Quick and easy!!</p>
<p><a rel="external nofollow" href="http://www.wprecipes.com/how-to-show-parent-page-title-regardless-of-what-subpage-you-are-on" target="_blank">Source Link</a></p>
<h4><span>05. <span style="text-decoration: underline;">Display Guest Author Name in The Front Page and Individual Posts</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/32455_lewh-05.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>The first thing we need to do is to set a wordpress if statement to get the custom filed value. This way it will only show up when the custom file value is assigned. Open up your <em>“index.php”</em> and <em>“single.php”</em> and paste the following code where you want the author name to show up. It could be after date or after comments. For example after this code:</p>
<pre>&lt;?php the_time(’M j, Y’) ?&gt;</pre>
<pre>&lt;?php if ( get_post_meta($post-&gt;ID, 'guest_author_name', true) ) { ?&gt;
// check to see if custom field guest author name exists
&lt;?php echo get_post_meta($post-&gt;ID, "guest_author_name", $single = true); ?&gt;
&lt;?php } ?&gt;</pre>
<p>Once we put the <em>if</em> statement we just call it on whichever post we want the guest author name to show up. The guest author name should show up on the front page and for specified post only.</p>
<p><a rel="external nofollow" href="http://desizntech.info/2009/10/wordpress-customs-fields-and-hacks-for-bloggers/" target="_blank">Source Link</a></div>
<h1><span>Post Related Hacks</span></h1>
<div>
<h4><span>06. <span style="text-decoration: underline;">How to Display Content in Multiple Columns</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/a6d31_lewh-06.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Printed magazines often display text in columns, so why blogs shouldn’t be able to do the same? here you can find out how to easily and automatically display your post content in columns.</p>
<p>This code is powerful but definitely easy to implement. Just paste it on your <em>functions.php</em> file and it will automatically output your post content in columns.<br />
Your post content will be splitted on <em>&lt;h2&gt;</em> tags.</p>
<pre>function my_multi_col($content){
  $columns = explode('&lt;h2&gt;', $content);

  $i = 0;

    foreach ($columns as $column){
    if (($i % 2) == 0){
      $return .= '&lt;div class="content_left"&gt;' . "\n";
      if ($i &gt; 1){
        $return .= "&lt;h2&gt;";
      } else{
        $return .= '&lt;div class="content_right"&gt;' . "\n &lt;h2&gt;";
      }
      $return .= $column;
      $return .= '&lt;/h2&gt;&lt;/div&gt;';
      $i++;
    }

    if(isset($columns[1])){
      $content = wpautop($return);
    }else{
      $content = wpautop($content);
    }
  echo $content;
  }
}
add_filter('the_content', 'my_multi_col');
&lt;/h2&gt;
&lt;/div&gt;
&lt;/h2&gt;</pre>
<p>Don’t forget to add the following styles to your <em>style.css</em> file :</p>
<pre>.content_right, .content_left{
  float:left;
  width:45%;
}

.content_left{
  padding-right:5%;
}</pre>
<p><a rel="external nofollow" href="http://www.kriesi.at/archives/wordpress-display-content-in-multiple-columns" target="_blank">Source Link</a></p>
<h4><span>07. <span style="text-decoration: underline;">How to Show WordPress Post Attachments</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/a6d31_lewh-07.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Since WordPress 2.5, attachments management in WordPress have been improved and is now very powerful. Today, we’re going to show you a simple code snippet that you can use in your WordPress theme to display post attachments.</p>
<p>To achieve this recipe, just paste the following code anywhere in your <em>post.php</em> file and attachments will be displayed.</p>
<pre>$args = array(
  'post_type' =&gt; 'attachment',
  'numberposts' =&gt; null,
  'post_status' =&gt; null,
  'post_parent' =&gt; $post-&gt;ID
);
$attachments = get_posts($args);
if ($attachments) {
  foreach ($attachments as $attachment) {
    echo apply_filters('the_title', $attachment-&gt;post_title);
    the_attachment_link($attachment-&gt;ID, false);
  }
}</pre>
<p><a rel="external nofollow" href="http://snipplr.com/view.php?codeview&amp;id=5375" target="_blank">Source Link</a></p>
<h4><span>08. <span style="text-decoration: underline;">How to Set Post Expiration Date/Time on Your WordPress Blog</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/78e12_lewh-08.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Sometimes (for example, if you’re running a contest), you want to be able to publish a post and then automatically stop displaying it after a certain date. This may seem quite hard to do but in fact is not, using the power of custom fields.</p>
<p>Edit your theme and replace your current WordPress loop with this “hacked” loop:</p>
<pre>&lt;?php
if (have_posts()) :
  while (have_posts()) : the_post(); ?&gt;
    $expirationtime = get_post_custom_values('expiration');
    if (is_array($expirationtime)) {
      $expirestring = implode($expirationtime);
    }

    $secondsbetween = strtotime($expirestring)-time();
    if ( $secondsbetween &gt; 0 ) {
      // For example...
      the_title();
      the_excerpt();
    }
  endwhile;
endif;
?&gt;</pre>
<p>To create a post set to expire at a certain date and time, just create a custom field. Specify expiration as a key and your date and time as a value (with the format mm/dd/yyyy 00:00:00). The post will not show up after the time on that stamp.</p>
<p>Note that this code does not remove or unpublish your post, but just prevents it from being displayed in the loop.</p>
<p><a rel="external nofollow" href="http://www.wprecipes.com/how-to-set-post-expiration-datetime-on-your-wordpress-blog" target="_blank">Source Link</a></p>
<h4><span>09. <span style="text-decoration: underline;">How to Style Posts Individually</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/78e12_lewh-09.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Your blog has a lot of posts, but the posts aren’t all of the same type. To give special styling to one or more of your posts, you can take advantage of both the <em>post_class()</em> function and the post ID.</p>
<p>To apply this trick, just open your <em>single.php</em> file, find the loop and replace it with the following:</p>
<pre>&lt;?php if (have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); ?&gt;
&lt;div &lt;?php post_class() ?&gt; id="post-&lt;?php the_ID(); ?&gt;"&gt;
&lt;h3&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;?php the_content(); ?&gt;
&lt;/div&gt;
&lt;?php endwhile; else: ?&gt;
&lt;?php _e('Sorry, no posts matched your criteria.'); ?&gt;
&lt;?php endif; ?&gt;</pre>
<p>The important part is mostly in line 3. Here, we have added the PHP <em>post_class()</em> function. Introduced in WordPress 2.8, this function adds CSS classes to the post. For example, it can add:</p>
<ul>
<li>.hentry</li>
<li>.sticky</li>
<li>.category-tutorials</li>
<li>.tag-wordpress</li>
</ul>
<p>With these CSS classes now added, you can now give a custom style to all posts that have the sticky tag or those that belong to the tutorials category.</p>
<p>The other important piece of this code is <em>id=”post-“</em>. By displaying the ID of the post here, we’re able to style a particular post. As an example:</p>
<pre>#post-876{
	background:#ccc;
}</pre>
<p><a rel="external nofollow" href="http://justagirlintheworld.com/take-advantage-of-the-new-sticky-post-feature-in-wordpress-27/" target="_blank">Source Link</a></p>
<h4><span>10. <span style="text-decoration: underline;">Display Content only to Registered Users in Your WordPress Blog</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/ebd2f_lewh-10.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>As you probably know, WordPress lets you decide whether to allow readers to create accounts and sign in to your blog. If you want to increase your blog’s registered readers or would just like to reward existing readers, why not keep some content private, just for them?</p>
<p>To achieve this hack, we’ll use a shortcode. The first step is to create it. Open your <em>functions.php</em> file and paste the following code:</p>
<pre>function member_check_shortcode($atts, $content = null) {
  if (is_user_logged_in() &amp;&amp; !is_null($content) &amp;&amp; !is_feed()) {
    return $content;
  } else {
    return 'Sorry, this part is only available to our members. Click here to become a member!';
  }

add_shortcode('member', 'member_check_shortcode');</pre>
<p>Once that’s done, you can add the following to your posts to create a section or text (or any other content) that will be displayed only to registered users:</p>
<pre>[member]
This text will be displayed only to registered users.
[/member]</pre>
<p>That’s it. Registered users will see the text contained in the shortcode, while unregistered users will see a message asking them to register.</p>
<p><a rel="external nofollow" href="http://justintadlock.com/archives/2009/05/09/using-shortcodes-to-show-members-only-content" target="_blank">Source Link</a></div>
<h1><span>Comment Page Related Hacks</span></h1>
<div>
<h4><span>11. <span style="text-decoration: underline;">How to Disable Comments in Old Posts via PHP</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/25b44_lewh-11.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>In many situations like when you’re giving some alert to your readers or warning, and you don’t want to hear any feedback. Or you simply don’t want to have any comments, pingbacks, or trackbacks for respective event. For such situation you really want to know how to disable comments, pingbacks, and trackbacks via PHP in your WordPress blog.</p>
<p>The first step is to create it. Open your <em>functions.php</em> file and paste the following code:</p>
<pre>&lt;?php
function close_comments( $posts ) {
  if ( !is_single() ) { return $posts; }
  if ( time() - strtotime( $posts[0]-&gt;post_date_gmt ) &gt; ( 30 * 24 * 60 * 60 ) ) {
    $posts[0]-&gt;comment_status = 'closed';
    $posts[0]-&gt;ping_status    = 'closed';
  }
  return $posts;
}
add_filter( 'the_posts', 'close_comments' );
?&gt;</pre>
<p>You can run this script as a plugin, through your theme’s <em>functions.php</em>, or through a custom <em>user-functions.php</em> file. Simply set the desired number of days by changing the number “30” to whatever you would like. As is, this script will close comments, pingbacks and trackbacks on all articles posted more than 30 days ago.</p>
<p><a rel="external nofollow" href="http://perishablepress.com/press/2008/07/08/wordpress-tip-disable-comments-in-old-posts-via-php/" target="_blank">Source Link</a></p>
<h4><span>12. <span style="text-decoration: underline;">How to Display Registered Users Comment Count on Your Blog</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/9411b_lewh-12.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>If your blog is private or have lots of registered users, it may be interesting to be able to display the number of comments posted by registered users. This is the purpose of this code.</p>
<p>Simply paste the following code where you’d like the count to be displayed. Re-arrange the code as desired.</p>
<pre>&lt;?php
global $wpdb;
$where = 'WHERE comment_approved = 1 AND user_id &lt;&gt; 0';
$comment_counts = (array) $wpdb-&gt;get_results("
    SELECT user_id, COUNT( * ) AS total
    FROM {$wpdb-&gt;comments}
    {$where}
    GROUP BY user_id
  ", object);
foreach ( $comment_counts as $count ) {
  $user = get_userdata($count-&gt;user_id);
  echo 'User ' . $user-&gt;display_name . ' comment count is ' . $count-&gt;total . '';
}
?&gt;</pre>
<p>That’s it! This will get approved comment count for each registered user.</p>
<p><a rel="external nofollow" href="http://wordpress.org/support/topic/269956" target="_blank">Source Link</a></p>
<h4><span>13. <span style="text-decoration: underline;">Separating Trackbacks From Comments in WordPress 2.7+</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/9411b_lewh-13.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Separating your trackbacks and comments requires a minimal amount of coding work to set up. First, you’ll want to make a backup of your <em>comments.php</em> file just in case something goes wrong. Next, follow these steps:</p>
<p>Access your <em>comments.php</em> file and locate the following code:</p>
<pre>&lt;?php foreach ($comments as $comment) : ?&gt;</pre>
<p>Immediately after the above code, you’ll want to place this code:</p>
<pre>&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type == 'comment') { ?&gt;</pre>
<p>Next, you’ll want to scroll down a little bit and locate the following code:</p>
<pre>&lt;?php endforeach; /* end for each comment */ ?&gt;</pre>
<p>Immediately before the above code, you’ll want to place this code:</p>
<pre>&lt;?php } /* End of is_comment statement */ ?&gt;</pre>
<p>This will filter out all of the trackbacks and pingbacks from your main comments loop. Now we need to create a second comments loop to display the trackbacks and pingbacks. Now, Almost immediately below the code from last step you should find this code:</p>
<pre>&lt;?php else : // this is displayed if there are no comments so far ?&gt;</pre>
<p>Immediately before the above code, you’ll want to place this code:</p>
<pre>&lt;h3&gt;Trackbacks&lt;/h3&gt;
&lt;ol&gt;
&lt;?php foreach ($comments as $comment) : ?&gt;
&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type != 'comment') { ?&gt;
&lt;li&gt;&lt;?php comment_author_link() ?&gt;&lt;/li&gt;
&lt;?php } ?&gt;
&lt;?php endforeach; ?&gt;
&lt;/ol&gt;</pre>
<p>Once you’ve got the comments successfully separated from the trackbacks, there are a couple additional tweaks you may want to do to clean up how things look (it really depends on preference I suppose).   The first is to clean up your trackbacks/pingbacks by only displaying the title instead of an excerpt and everything else. In order to do this, you’ll need to find the following code in your <em>comments.php</em> file:</p>
<pre>&lt;ol&gt;
&lt;?php wp_list_comments('type=pings'); ?&gt;
&lt;/ol&gt;</pre>
<p>Now replace that code with the following:</p>
<pre>&lt;ol&gt;
&lt;?php wp_list_comments('type=pings&amp;callback=list_pings'); ?&gt;
&lt;/ol&gt;</pre>
<p>Lastly, you’ll need to add the following code to your <em>functions.php</em> file (which can be created if you don’t already have one):</p>
<pre>&lt;?php
function list_pings($comment, $args, $depth) {
  $GLOBALS['comment'] = $comment;
?&gt;
&lt;li id="comment-&lt;?php comment_ID(); ?&gt;"&gt;&lt;?php comment_author_link(); ?&gt;
&lt;?php } ?&gt;
&lt;/li&gt;</pre>
<p>That should clean up the trackbacks/pingbacks section and you can also apply the same changes if you use a plugin to display tweetbacks.</p>
<p>The other thing you may want to do is fix the comment count to only show actual comments, filtering out the trackbacks/pingbacks which are included in your comment count by default.   Simply add the following code to your <em>functions.php</em> file (which again can be created if you don’t already have one):</p>
<pre>&lt;?php
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
  if ( ! is_admin() ) {
    global $id;
    $comments_by_type = &amp;separate_comments(get_comments('status=approve&amp;post_id=' . $id));
    return count($comments_by_type['comment']);
  } else {
    return $count;
  }
}
?&gt;</pre>
<p>So there you go. Now you have succesfully separated trackbacks from comments!</p>
<p><a rel="external nofollow" href="http://wphacks.com/separating-trackbacks-from-comments-in-wordpress-2-7/" target="_blank">Source Link</a></div>
<h1><span>Images Related Hacks</span></h1>
<div>
<h4><span>14. <span style="text-decoration: underline;">Automatically Resize Pictures on Your WordPress Blog</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/af2c1_lewh-14.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>You know it, a picture is worth a thousand words. But pictures means that you have to resize it, which is alwyas boring.<br />
Happilly, a very cool script called TimThumb can resize pictures for you. The function below create a WordPress shortcode that will make Timthumb use even easier.</p>
<pre>function imageresizer( $atts, $content = null ) {
  return '<img src="http://www.instantshift.com/timthumb/timthumb.php?src='.$content.'&amp;w=590" alt="" />';
}

add_shortcode('img', 'imageresizer');</pre>
<p>Then, you can use the following syntax to add an automatically resized image to your blog post:</p>
<pre>[img]http://www.yoursite.com/yourimage.jpg[/img]</pre>
<p><a rel="external nofollow" href="http://www.wprecipes.com/automatically-resize-pictures-on-your-wordpress-blog" target="_blank">Source Link</a></div>
<h1><span>Social Networking and Email Related Hacks</span></h1>
<div>
<h4><span>15. <span style="text-decoration: underline;">How to Create a Tweetmeme “Retweeet” Shortcode</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/09819_lewh-15.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Twitter is one of the best way to get quality traffic to your blog. In order to help people sharing your articles on Twitter, you should definitely implement a Tweetmeme button, which display how many time time people RT’d your blog posts.</p>
<p>Just paste the function below into your <em>functions.php</em> file.</p>
<pre>function tweetmeme(){
  return '&amp;lt;div class=&amp;quot;tweetmeme&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://tweetmeme.com/i/scripts/button.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/div&amp;gt;';
}
add_shortcode('tweet', 'tweetmeme');</pre>
<p>Once you saved the file, you’ll be able to display the Tweetmeme “retweet” button anywhere on your posts. In WordPress editor, make sure you are in HTML mode and insert the following:</p>
<pre>[tweet]</pre>
<p>When your post will be published, the shortcode will be replaced by the TweetMeme button.</p>
<p><a rel="external nofollow" href="http://www.wprecipes.com/wordpress-tip-create-a-tweetmeme-retweeet-shortcode" target="_blank">Source Link</a></p>
<h4><span>16. <span style="text-decoration: underline;">Send Article to a Friend by Email</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/09819_lewh-16.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>In order to create more traffic on your blog, it can be a good idea to let your readers send your posts to their friends by email.</p>
<p>To apply this recipe to your blog, simply paste the following function into your <em>functions.php</em> file, and that’s all. Hard to do something simpler!</p>
<pre>function direct_email($text=&amp;quot;Send by email&amp;quot;){
  global $post;
  $title = htmlspecialchars($post-&amp;gt;post_title);
  $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
  $body = 'I recommend this page : '.$title.'. You can read it on : '.get_permalink($post-&amp;gt;ID);
  $link = '&amp;lt;a rel=&amp;quot;nofollow&amp;quot; href=&amp;quot;mailto:?subject='.rawurlencode($subject).'&amp;amp;amp;body='.rawurlencode($body).'&amp;quot; title=&amp;quot;'.$text.' : '.$title.'&amp;quot;&amp;gt;'.$text.'&amp;lt;/a&amp;gt;';
  return $link;
}</pre>
<p><a rel="external nofollow" href="http://www.webinventif.fr/wordpress-lien-envoyer-page-mail/" target="_blank">Source Link</a></div>
<h1><span>Author Related Hacks</span></h1>
<div>
<h4><span>17. <span style="text-decoration: underline;">Automatically Insert Author Bio on Each Post</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/67a70_lewh-17.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>When you’re owning a multi-writers blog, it is important to show who wrote the post. In case of guest bloggers, it is also a nice way to give credit.</p>
<p>Simply insert the following lines of code into your <em>functions.php</em> file, and that’s all. Author bio will be automatically displayed after each post.</p>
<pre>function get_author_bio ($content=''){
  global $post;

  $post_author_name=get_the_author_meta("display_name");
  $post_author_description=get_the_author_meta("description");
  $html="
<div>\n";
  $html.="<img class="avatar" alt="" width="80" height="80" />\n";
  $html.="
<div>\n";
  $html.="
<h4>Author: <span>".$post_author_name."</span></h4>

\n";
  $html.= $post_author_description."\n";
  $html.="</div>

\n";
  $html.="

\n";
  $content .= $html;
  }
  return $content;
}

add_filter('the_content', 'get_author_bio');</div>
</pre>
<p><a rel="external nofollow" href="http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/" target="_blank">Source Link</a></div>
<h1><span>Feeds Related Hacks</span></h1>
<div>
<h4><span>18. <span style="text-decoration: underline;">How to Fetch and Display RSS Feeds</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/67a70_lewh-18.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Do you know that WordPress have a built-in RSS reader? And you can use this feed to utilize in many ways. Here we’ll tell how to import and display feeds in wordPress 2.8 and beyond.</p>
<p>Simply paste the following code where you want the feed to be displayed. Don’t forget to define feed url at line 4.</p>
<pre>&lt;?php if(function_exists('fetch_feed')) {

  include_once(ABSPATH.WPINC.'/feed.php');
  $feed = fetch_feed('http://feeds.feedburner.com/catswhoblog');

  $limit = $feed-&gt;get_item_quantity(7); // specify number of items
  $items = $feed-&gt;get_items(0, $limit); // create an array of items

}
if ($limit == 0) echo '&lt;div&gt;The feed is either empty or unavailable.&lt;/div&gt;';
else foreach ($items as $item) : ?&gt;

  &lt;div&gt;
    &lt;a href="&lt;?php echo $item-&gt;get_permalink(); ?&gt;" title="&lt;?php echo $item-&gt;get_date('j F Y @ g:i a'); ?&gt;"&gt;
      &lt;?php echo $item-&gt;get_title(); ?&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;?php echo substr($item-&gt;get_description(), 0, 200); ?&gt;
    &lt;span&gt;[...]&lt;/span&gt;
  &lt;/div&gt;

&lt;?php endforeach; ?&gt;</pre>
<p><a rel="external nofollow" href="http://digwp.com/2009/11/import-and-display-feeds-in-wordpress/" target="_blank">Source Link</a></div>
<h1><span>Category and Tags Related Hacks</span></h1>
<div>
<h4><span>19. <span style="text-decoration: underline;">How to Change Excerpt Length Depending of the Category</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/ea052_lewh-19.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>Do you ever wished to be able to modify the excerpt length based on which category you are on, without modifying your theme files? If yes, we’re pretty sure you’ll be happy with this hack.</p>
<p>No need to modify your theme files. Simply paste the code into your <em>functions.php</em> file. Don’t forget to change the category ID on line 3!</p>
<pre>add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
  if(in_category(14)) {
    return 13;
  } else {
    return 60;
  }
}</pre>
<p><a rel="external nofollow" href="http://www.wprecipes.com/wordpress-tip-change-excerpt-length-depending-of-the-category" target="_blank">Source Link</a></p>
<h4><span>20. <span style="text-decoration: underline;">Create a Function to Get Tags Related to Category</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/5c5ac_lewh-20.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>First, here is the function you have to paste in your <em>functions.php</em> file:</p>
<pre>function get_category_tags($args) {
  global $wpdb;
  $tags = $wpdb-&gt;get_results
  ("
    SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link
    FROM
      wp_posts as p1
      LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID
      LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
      LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,
      wp_posts as p2
      LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID
      LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
      LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id
    WHERE
      t1.taxonomy = 'category' AND p1.post_status = 'publish' AND terms1.term_id IN (".$args['categories'].") AND
      t2.taxonomy = 'post_tag' AND p2.post_status = 'publish'
      AND p1.ID = p2.ID
    ORDER by tag_name
  ");
  $count = 0;
  foreach ($tags as $tag) {
    $tags[$count]-&gt;tag_link = get_tag_link($tag-&gt;tag_id);
    $count++;
  }
  return $tags;
}</pre>
<p>Once you have pasted the function, you can use it in your theme:</p>
<pre>$args = array('categories' =&gt; '12,13,14');
$tags = get_category_tags($args);</pre>
<p><a rel="external nofollow" href="http://www.wprecipes.com/wordpress-trick-function-to-get-tags-related-to-category" target="_blank">Source Link</a></div>
<h1><span>Plugin Related Hacks</span></h1>
<div>
<h4><span>21. <span style="text-decoration: underline;">How to Create an Anti-IE6 Plugin</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/5c5ac_lewh-21.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>With this amazing code created by Nathan Rice, you’ll be able to serve IE6 users the default WordPress theme. After all, those idiots don’t deserve anything better</p>
<p>Just paste the following in a new file and save it as <em>ie6.php</em>. Upload it to your wp-content/plugins directory and activate it on your WordPress dashboard.</p>
<pre>&lt;?php
/*
Plugin Name: Serve Default to IE6
Plugin URI: http://www.nathanrice.net/blog/serve-ie6-visitors-the-default-wordpress-theme
Description: This plugin will serve the default theme to any visitors using IE6.
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
Version: 1.0
*/

add_filter('template', 'serve_default_to_iesix');
add_filter('option_template', 'serve_default_to_iesix');
add_filter('option_stylesheet', 'serve_default_to_iesix');
function serve_default_to_iesix($theme) {
  if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false)
    $theme = 'default';
  return $theme;
}
?&gt;</pre>
<p><a rel="external nofollow" href="http://www.nathanrice.net/blog/serve-ie6-visitors-the-default-wordpress-theme/" target="_blank">Source Link</a></p>
<h4><span>22. <span style="text-decoration: underline;">How to Check if a Plugin is Active or Not</span></span></h4>
<p><img class="alignnone size-full top_m" src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/a8045_lewh-22.jpg" alt="instantShift - Exceptional WordPress Hacks" width="560" height="210" /></p>
<p>When working with lots and lots of plugins, it can be useful for developers to be able to check if a particular WordPress plugin is active or not. If you want to check if a WordPress plugin is active, just use the <em>is_plugin_active()</em> function. The function takes a single parameter, which is the path to the plugin, as shown in below:</p>
<pre>&lt;?php
if (is_plugin_active('plugin-directory/plugin-file.php')) {
	//plugin is activated
}
?&gt;</pre>
<p><a rel="external nofollow" href="http://www.wprecipes.com/check-if-a-wordpress-plugin-is-active-the-easy-way" target="_blank">Source Link</a></div>
</div>
<p><img src="http://www.buildmeafabwebsite.co.uk/wp-content/plugins/wp-o-matic/cache/a8045_s2SezQMDe6A" alt="" width="1" height="1" /><br />
This post was generated by an RSS Feed from <a href="http://www.instantshift.com/" target="_blank">Instant Shift</a><strong>You may also like to read:</strong>
<ul class="similar-posts">
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/10-more-wordpress-hacks-for-easy-life/" rel="bookmark" title="December 25, 2009">10 More WordPress Hacks for Easy Life</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-remove-%e2%80%9cprivate%e2%80%9d-and-%e2%80%9cprotected%e2%80%9d-from-the-post-title/" rel="bookmark" title="February 25, 2010">How to remove “private” and “protected” from the post title</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/how-to-modify-lists-like-%e2%80%98categories%e2%80%99-and-%e2%80%98blogroll%e2%80%99-in-wordpress/" rel="bookmark" title="December 10, 2009">How to modify lists like ‘Categories’ and ‘Blogroll’ in WordPress?</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/display-most-recent-comments-with-gravatar/" rel="bookmark" title="January 25, 2010">Display most recent comments with Gravatar</a></li>
<li><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/wordpress-hack-get-popular-posts-by-comments-count/" rel="bookmark" title="June 11, 2010">WordPress hack: Get popular posts by comments count</a></li>
</ul>
<p><!-- Similar Posts took 26.636 ms --></p>
<p><a href="http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/">22 Latest Exceptional WordPress Hacks</a> is a post from: <a href="http://www.buildmeafabwebsite.co.uk">Build Me A Fab Website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.buildmeafabwebsite.co.uk/wordpress-tutorials/22-latest-exceptional-wordpress-hacks-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

