<?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>Awesome Wordpress Theme &#187; Wordpress Hack</title>
	<atom:link href="http://www.awesomewordpresstheme.com/category/wordpress/wordpress-hack/feed" rel="self" type="application/rss+xml" />
	<link>http://www.awesomewordpresstheme.com</link>
	<description>Gives you list of most beautiful, gorgeous, elegant and superb Wordpress themes designs, both premium and free Wordpress themes are shared here</description>
	<lastBuildDate>Thu, 08 Jul 2010 20:13:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How To Shorten WordPress Blog Post URL For Twitter</title>
		<link>http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html</link>
		<comments>http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:24:07 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[Post URL]]></category>
		<category><![CDATA[Shorten Long URL]]></category>
		<category><![CDATA[Shorten URL]]></category>
		<category><![CDATA[TinyUrl]]></category>
		<category><![CDATA[Tr.Im]]></category>
		<category><![CDATA[Url For Twitter]]></category>
		<category><![CDATA[Wordpress Url]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=417</guid>
		<description><![CDATA[This is going to be a short tutorial post, it&#8217;s about shortening your WordPress blog post url for Twitter, but automatically. Widely known short aliases sites like tr.im and tinyurl is good for shortening long URL into cute &#038; short one. Therefore I am going to use them to automatically shortening post url. To start the tutorial let&#8217;s head to [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fhow-to-shorten-wordpress-blog-post-url-for-twitter.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fhow-to-shorten-wordpress-blog-post-url-for-twitter.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>This is going</strong> to be a short tutorial post, it&#8217;s about shortening your <a href="http://www.awesomewordpresstheme.com/category/wordpress">WordPress</a> blog post url for Twitter, but automatically. Widely known short aliases sites like tr.im and tinyurl is good for shortening long URL into cute &#038; short one. Therefore I am going to use them to automatically shortening post url. <span id="more-417"></span></p>
<p><strong>To start the tutorial let&#8217;s head to functions.php file &#038; use tinyurl</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">function getTinyUrl($url) { $tinyurl = file_get_contents(&quot;http://tinyurl.com/api-create.php?url=&quot;.$url); return $tinyurl; }</pre></td></tr></table></div>

<p>Put that code inside your functions.php and then add the following code inside your single.php:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">&lt;?php $turl = getTinyUrl(get_permalink($post-&gt;ID)); echo 'Tiny Url for this post: &lt;a href=&quot;'.$turl.'&quot;&gt;'.$turl.'&lt;/a&gt;' ?&gt;</pre></td></tr></table></div>

<p><em>Or you want to use tr.im, that&#8217;s fine, follow the following steps then:</em></p>
<p>Open your functions.php file &#038; add the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">function getTrimUrl($url) { $tinyurl = file_get_contents(&quot;http://api.tr.im/api/trim_simple?url=&quot;.$url); return $tinyurl; }</pre></td></tr></table></div>

<p>And add this code inside your single.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">&lt;?php $turl = getTrimUrl(get_permalink($post-&gt;ID)); echo 'Short Url for this post: &lt;a href=&quot;'.$turl.'&quot;&gt;'.$turl.'&lt;/a&gt;' ?&gt;</pre></td></tr></table></div>

<blockquote><p>I got this tutorial from <a href="http://wpwebhost.com/" target="_blank">Wp WebHost</a> in one of his post entitled  <a href="http://wpwebhost.com/five-awesome-functions-php-tricks-in-wordpress/" target="_blank" rel="nofollow">Five Awesome functions.php Tricks in WordPress</a></p></blockquote>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guide To Separate WordPress Comments And TrackBacks</title>
		<link>http://www.awesomewordpresstheme.com/guide-to-separate-wordpress-comments-and-trackbacks.html</link>
		<comments>http://www.awesomewordpresstheme.com/guide-to-separate-wordpress-comments-and-trackbacks.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:30:11 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[Comment Area]]></category>
		<category><![CDATA[Separate Comments]]></category>
		<category><![CDATA[Trackbacks]]></category>
		<category><![CDATA[Wordpress Comments]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=338</guid>
		<description><![CDATA[If you have many useful and quality contents in your WordPress blog, you will likely get many trackbacks from other bloggers, those trackbacks usually appear inside the comment area and as the result they will be mixed with comments of your readers, this is sometimes disrupting the conversation among your visitors and looks not too neat. And by default not [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fguide-to-separate-wordpress-comments-and-trackbacks.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fguide-to-separate-wordpress-comments-and-trackbacks.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you have many useful and quality contents in your <a href="http://www.awesomewordpresstheme.com/category/wordpress">WordPress</a> blog, you will likely get many trackbacks from other bloggers, those trackbacks usually appear inside the comment area and as the result they will be mixed with comments of your readers, this is sometimes disrupting the conversation among your visitors and looks not too neat.<span id="more-338"></span></p>
<p>And by default not all <a href="http://www.awesomewordpresstheme.com/category/theme-styles">WordPress themes</a> are designed with trackback and comment separated, thus we get to make them separated. And follow these steps to do so.</p>
<p><strong>Steps How To Separate Comments And TrackBacks:</strong></p>
<p>Head to your <code>comment.php</code> and find this code:</p>
<p><code>&lt;?php foreach ($comments as $comment) : ?&gt;</code></p>
<p>Right after the above code, put the following code, now:</p>
<p><code>&lt;?php $comment_type = get_comment_type(); ?&gt;<br />
&lt;?php if($comment_type == &#039;comment&#039;) { ?&gt;</code></p>
<p>And then find this code:</p>
<p><code>&lt;?php endforeach; /* end for each comment */ ?&gt;</code></p>
<p>Just before the above code put this code:</p>
<p><code>&lt;?php } else { $trackback = true; } /* End of is_comment statement */ ?&gt;</code></p>
<p>What you&#8217;ve done above is to tell WordPress not to display trackbacks inside the comment area. But since we still need to display trackbacks too, then follow these steps to put trackbacks in separated area from your comment area to make your comment area is free from any trackbacks nor pinbacks.</p>
<p>Find this one:</p>
<p><code>&lt;?php else : // this is displayed if there are no comments so far ?&gt;</code></p>
<p>Before the above code put this one:</p>
<p><code>&lt;?php if ($trackback == true) { ?&gt;<br />
&lt;h3&gt;Trackbacks&lt;/h3&gt;<br />
&lt;ol&gt;<br />
&lt;?php foreach ($comments as $comment) : ?&gt;<br />
&lt;?php $comment_type = get_comment_type(); ?&gt;<br />
&lt;?php if($comment_type != &#039;comment&#039;) { ?&gt;<br />
&lt;li&gt;&lt;?php comment_author_link() ?&gt;&lt;/li&gt;<br />
&lt;?php } ?&gt;<br />
&lt;?php endforeach; ?&gt;<br />
&lt;/ol&gt;<br />
&lt;?php } ?&gt;</code></p>
<p>Done! This hack only works if you set your trackbacks enabled or else just ignore this hack, and hope you&#8217;ll find this hack useful and see you in then next post of <a href="http://www.awesomewordpresstheme.com/">Premium WordPress</a> Blog.</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/guide-to-separate-wordpress-comments-and-trackbacks.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial To Split WordPress Post Into Separated Pages</title>
		<link>http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html</link>
		<comments>http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html#comments</comments>
		<pubDate>Sun, 30 Aug 2009 16:36:41 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Separate Page]]></category>
		<category><![CDATA[Split Post]]></category>
		<category><![CDATA[Split Wordpress]]></category>
		<category><![CDATA[Wordpress Article]]></category>
		<category><![CDATA[Wordpress Post]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=300</guid>
		<description><![CDATA[If you have very lengthy posts then you can separate or split the posts into several pages, this way will avoid your article become too lengthy and of course your readers will not be lazy for continue reading your article entirely. What you need to do to split your article or post into several pages is by adding an additional [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Ftutorial-to-split-wordpress-post-into-separated-pages.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Ftutorial-to-split-wordpress-post-into-separated-pages.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you have very lengthy posts then <strong>you can separate or split the posts into several pages</strong>, this way will avoid your article become too lengthy and of course your readers will not be lazy for continue reading your article entirely. What you need to do to split your article or post into several pages is by adding an additional code into your single.php and your post. Here&#8217;s the steps, but firstly I recommend that you back up your single.php before doing any change, if something goes wrong you have back up:<span id="more-300"></span></p>
<p>Ok now head to your <code>single.php</code> and find this code:</p>
<p><code>&lt;?php the_content(); ?&gt;</code></p>
<p>And put this code right after it:</p>
<p><code><br />
&lt;?php wp_link_pages(&#039;&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; &#039;, &#039;&lt;/p&gt;&#039;, &#039;number&#039;); ?&gt;</code></p>
<p>Thus it should look exactly like this:</p>
<p><code><br />
&lt;?php the_content(); ?&gt;<br />
&lt;?php wp_link_pages(&#039;&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; &#039;, &#039;&lt;/p&gt;&#039;, &#039;number&#039;); ?&gt;</code></p>
<p>And then update your single.php or save it.</p>
<p>Now go to &#8220;Add new&#8221; post or &#8220;Edit&#8221; post you consider too lengthy and select &#8220;HTML&#8221; not &#8220;Visual&#8221; to make the code we are about to add works. Oke chose the part you consider deserve separation and add this following code (the code will split or separate your article into several pages or any page you need):</p>
<p><code>&lt;!–nextpage–&gt;</code></p>
<p>See the following image to get the clearer picture:</p>
<p><img class="aligncenter" src="http://2.bp.blogspot.com/_sknNoel7lZI/SeTKKauajlI/AAAAAAAAADI/j2vsFZ6StFA/s320/paginasi.JPG" alt="Add NextPage Code Inside Wordpess Article Post" width="320" height="182" /></p>
<p>And then publish your article, you will then see number of the pages or page navigation right beneath your post, and it looks generally like this one:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://i570.photobucket.com/albums/ss149/abibakar/SplittedWordPressPages.jpg" alt="Page Navigation In Article WordPress Post" width="157" height="78" /></p>
<p>Finish! Hope you find this post useful &#038; see you in the next post.</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Show Most Popular Post In WordPress Without Plugin</title>
		<link>http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html</link>
		<comments>http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html#comments</comments>
		<pubDate>Sun, 07 Jun 2009 08:15:44 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[Popular Post]]></category>
		<category><![CDATA[Without Plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=261</guid>
		<description><![CDATA[If you don&#8217;t want to burden your server with too many plugins, perhaps using a certain php code to display several features that usually easy to active with plugins will help your server, such as displaying related post without plugin and you can display most popular post without plugin too. This php code serves similar intention as popularity plugin, but [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fshow-most-popular-post-in-wordpress-without-plugin.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fshow-most-popular-post-in-wordpress-without-plugin.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you don&#8217;t want to burden your server with too many plugins, perhaps using a certain php code to display several features that usually easy to active with plugins will help your server, such as <a href="http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html">displaying related post without plugin</a> and you can display most popular post without plugin too. This php code serves similar intention as popularity plugin, but the different is it&#8217;s php code of which we must do a little work with our function.php and other folders depend on where you want to put it.<span id="more-261"></span></p>
<p>The first thing you need to do now is back up your function.php file in case something wrong happen, and open your function.php file add this code within it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">function most_popular_posts($no_posts = 10, $before = '&lt;li&gt;', $after = '&lt;/li&gt;', $show_pass_post = false, $duration='') {
global $wpdb;
$request = &quot;SELECT ID, post_title, COUNT($wpdb-&gt;comments.comment_post_ID) AS 'comment_count' FROM $wpdb-&gt;posts, $wpdb-&gt;comments&quot;;
$request .= &quot; WHERE comment_approved = '1' AND $wpdb-&gt;posts.ID=$wpdb-&gt;comments.comment_post_ID AND post_status = 'publish'&quot;;
if(!$show_pass_post) $request .= &quot; AND post_password =''&quot;;
if($duration !=&quot;&quot;) { $request .= &quot; AND DATE_SUB(CURDATE(),INTERVAL &quot;.$duration.&quot; DAY) &lt; post_date &quot;;
}
$request .= &quot; GROUP BY $wpdb-&gt;comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts&quot;;
$posts = $wpdb-&gt;get_results($request);
$output = '';
if ($posts) {
foreach ($posts as $post) {
$post_title = stripslashes($post-&gt;post_title);
$comment_count = $post-&gt;comment_count;
$permalink = get_permalink($post-&gt;ID);
$output .= $before . '&lt;a href=&quot;' . $permalink . '&quot; title=&quot;' . $post_title.'&quot;&gt;' . $post_title . '&lt;/a&gt; (' . $comment_count.')' . $after;
}
} else {
$output .= $before . &quot;None found&quot; . $after;
}
echo $output;
}</pre></td></tr></table></div>

<p>What we have just done is create a new function called most_popular_posts. Now all we have to do is use our new function. Open sidebar.php and add <?php most_popular_posts(); ?> wherever you want the list to appear. Using the default Kubrick theme as an example, you would have this &#8230;</p>
<p>We have created a new order inside our function.php file called most_popular_posts. The next step is telling our theme to display the newly order, open your sidebar or footer or anywhere you want to add the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="language" style="font-family:monospace;"> &lt;li&gt;&lt;h2&gt;Popular&lt;/h2&gt;
&lt;ul&gt;&lt;?php most_popular_posts(); ?&gt;&lt;/ul&gt;
&lt;/li&gt;</pre></td></tr></table></div>

<p>If you want to control number of articles inside your popular post, you can change in the line <strong>$no_posts = 10</strong>. Thanks to <a href="http://riteturnonly.com/2009/04/10/how-to-show-most-popular-posts-without-a-plugin/" target="_blank">RiteTurnOnly</a> for making this tutorial available online!</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html' rel='bookmark' title='Permanent Link: Tutorial To Show Ads only on WordPress Homepage'>Tutorial To Show Ads only on WordPress Homepage</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Display Related Post In WordPress Without Plugin</title>
		<link>http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html</link>
		<comments>http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html#comments</comments>
		<pubDate>Thu, 04 Jun 2009 03:52:24 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[No Plugin]]></category>
		<category><![CDATA[PHP Code]]></category>
		<category><![CDATA[Related Post]]></category>
		<category><![CDATA[Related Post Category]]></category>
		<category><![CDATA[Related Post Tags]]></category>
		<category><![CDATA[Single PHP]]></category>
		<category><![CDATA[Without Plugin]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=245</guid>
		<description><![CDATA[One of the reason that makes your WordPress blog takes long time to load is too many plugin installed in your dashboard, so it will better to have minimum plugin possible to reduce loading times, and one of which is by using PHP code to display related post instead of using related post plugin. And the following are 2 methods [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fdisplay-related-post-in-wordpress-without-plugin.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fdisplay-related-post-in-wordpress-without-plugin.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the reason that makes your <a href="http://www.awesomewordpresstheme.com/category/wordpress">WordPress</a> blog takes long time to load is too many plugin installed in your dashboard, so it will better to have minimum plugin possible to reduce loading times, and one of which is by using PHP code to display related post instead of using related post plugin.<span id="more-245"></span></p>
<p>And the following are 2 methods to display related post based on category and tag, and I will firstly warn you to <strong>back up your file</strong> before start doing anything to your <strong>Single.php</strong> file, or else you&#8217;ll be sorry if anything goes wrong, ok let&#8217;s get started.<br />
<strong><br />
1. Displaying related post based on Category (Categories):</strong></p>
<p>Login to your WordPress dashboard , go to your <strong>Appearance</strong>-&gt; <strong>Editor</strong> and open your <strong>Single.php</strong> file, and add this code beneath your post content, like after this tag for example: &lt;?php the_content() ?&gt;:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">    &lt;?php
    $this_post = $post;
    $category = get_the_category(); $category = $category[0]; $category = $category-&gt;cat_ID;
    $posts = get_posts('numberposts=6&amp;offset=0&amp;orderby=post_date&amp;order=DESC&amp;category='.$category);
    $count = 0;
    foreach ( $posts as $post ) {
    if ( $post-&gt;ID == $this_post-&gt;ID || $count == 5) {
    unset($posts[$count]);
    }else{
    $count ++;
    }
    }
    ?&gt;
&nbsp;
    &lt;?php if ( $posts ) : ?&gt;
    &lt;div class=&quot;related_articles&quot;&gt;
    &lt;h2&gt;Related Posts&lt;/h2&gt;
    &lt;ul&gt;
    &lt;?php foreach ( $posts as $post ) : ?&gt;
    &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; title=&quot;&lt;?php echo trim(str_replace(&quot;n&quot;,&quot; &quot;,preg_replace('#&lt;[^&gt;]*?&gt;#si','',get_the_excerpt()))) ?&gt;&quot;&gt;&lt;?php if ( get_the_title() ){ the_title(); }else{ echo &quot;Untitled&quot;; } ?&gt;&lt;/a&gt; (&lt;?php the_time('F jS, Y') ?&gt;)&lt;/li&gt;
    &lt;?php endforeach // $posts as $post ?&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
    &lt;?php endif // $posts ?&gt;
    &lt;?php
    $post = $this_post;
    unset($this_post);
    ?&gt;</pre></td></tr></table></div>

<p><strong><br />
2. Displaying related post based on Tag (Tags):</strong></p>
<p>Do exactly the same as the above steps and add this PHP code inside your Single.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">&lt;?php
$tags = wp_get_post_tags($post-&gt;ID);
if ($tags) {
    $tag_ids = array();
    foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id;
&nbsp;
    $args=array(
        'tag__in' =&gt; $tag_ids,
        'post__not_in' =&gt; array($post-&gt;ID),
        'showposts'=&gt;5, // Number of related posts that will be shown.
        'caller_get_posts'=&gt;1
    );
    $my_query = new wp_query($args);
    if( $my_query-&gt;have_posts() ) {
        echo '&lt;h3&gt;Related Posts&lt;/h3&gt;&lt;ul&gt;';
        while ($my_query-&gt;have_posts()) {
            $my_query-&gt;the_post();
        ?&gt;
            &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;?php
        }
        echo '&lt;/ul&gt;';
    }
}
?&gt;</pre></td></tr></table></div>

<p>Then click this -> <strong>Update File</strong> or <strong>Save</strong>. </p>
<p>Now your related posts will appear in each of your post. Hope this post useful to you, and see you in the next post.</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Tutorial To Show Ads only on WordPress Homepage</title>
		<link>http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html</link>
		<comments>http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html#comments</comments>
		<pubDate>Mon, 18 May 2009 13:54:46 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[Ads]]></category>
		<category><![CDATA[Display Ads]]></category>
		<category><![CDATA[Homepaga Ads]]></category>
		<category><![CDATA[Show Ads]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=217</guid>
		<description><![CDATA[Playing around with WordPress always fun especially this CMS is very easy to customize so to make Ads only show up on Homepage and is hided on single pages. The steps is pretty simple, if you want to make the ads only appears on WordPress homepage you should place a short code to your index.php, here&#8217;s the steps: 1. Open [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Ftutorial-to-show-ads-only-on-wordpress-homepage.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Ftutorial-to-show-ads-only-on-wordpress-homepage.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Playing around with <a href="http://www.awesomewordpresstheme.com/category/wordpress">WordPress</a> always fun especially this CMS is very easy to customize so to make Ads only show up on Homepage and is hided on single pages. The steps is pretty simple, if you want <strong>to make the ads only appears on WordPress homepage</strong> you should place a short code to your index.php, here&#8217;s the steps:<span id="more-217"></span></p>
<p>1. Open your index.php.<br />
2. Put the following code with your Ads code or link anywhere inside your Index.php file:</p>
<blockquote><p>&lt;?php if(is_home() &amp;&amp; $post==$posts[0] &amp;&amp; !is_paged()) { ?&gt;<br />
     Your Ads code or text link<br />
&lt;?php } ?&gt;</p></blockquote>
<p>3. Save or update the file.</p>
<p>By that short code you have told WordPress to show the Ads or text link on homepage only and hide them on other pages in your <a href="http://www.awesomewordpresstheme.com/category/theme-styles/newspaper-themes">WordPress blog</a> and that&#8217;s the simple <a href="http://www.awesomewordpresstheme.com/category/wordpress/wordpress-hack">WordPress Hack</a>.</p>
<p>See you in the next post.</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/tutorial-to-split-wordpress-post-into-separated-pages.html' rel='bookmark' title='Permanent Link: Tutorial To Split WordPress Post Into Separated Pages'>Tutorial To Split WordPress Post Into Separated Pages</a></li>
<li><a href='http://www.awesomewordpresstheme.com/show-most-popular-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Show Most Popular Post In WordPress Without Plugin'>Show Most Popular Post In WordPress Without Plugin</a></li>
<li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/tutorial-to-show-ads-only-on-wordpress-homepage.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Delete Category From WordPress Default Category Url</title>
		<link>http://www.awesomewordpresstheme.com/delete-category-from-default-category-url.html</link>
		<comments>http://www.awesomewordpresstheme.com/delete-category-from-default-category-url.html#comments</comments>
		<pubDate>Sun, 03 May 2009 15:48:44 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Wordpress Hack]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[Permalink]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.awesomewordpresstheme.com/?p=121</guid>
		<description><![CDATA[By default WordPress set category url with the word &#8220;category&#8221; or prefix within it. But some people regard as ugly url and not too SEO url. Actually we can remove the word, and there are 2 ways to remove the word &#8220;category&#8221; in category url, one with plugin or add php tag in category template php. And in this post [...]


Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
<li><a href='http://www.awesomewordpresstheme.com/wordpress-2-9-will-be-released-on-october-30.html' rel='bookmark' title='Permanent Link: WordPress 2.9 Will Be Released On October 30'>WordPress 2.9 Will Be Released On October 30</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fdelete-category-from-default-category-url.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.awesomewordpresstheme.com%2Fdelete-category-from-default-category-url.html&amp;source=wpman&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>By default WordPress set category url with the word &#8220;category&#8221; or prefix within it. But some people regard as ugly url and not too SEO url. Actually we can remove the word, and there are 2 ways to remove the word &#8220;category&#8221; in category url, one with plugin or add php tag in category template php. And in this post <a href="http://rumahabi.com/delete-the-word-category-in-wordpress-category-url-with-plugins-and-php-tag.html" target="_blank">SEO Blog</a> will explain on how to remove word &#8220;Category&#8221;.<span id="more-121"></span></p>
<p>I give a picture of what I am talking now, your category url by default is like this:</p>
<p><strong>http://blogname.com/category/seo</strong></p>
<p>And we want to remove the word &#8220;Category&#8221; into this url:</p>
<p><strong>http://blogname.com/seo</strong></p>
<p>*. <strong>SEO</strong> is the name of the category.</p>
<p>1. <strong>Using Plugins</strong>, there are 2 plugins I know that could remove the “category/” text from WordPress URL string</p>
<p>A. <strong>Using Top Level Categories</strong></p>
<p>You can <a rel="nofollow" href="http://fortes.com/projects/wordpress/top-level-cats/" target="_blank">download the Top level Categories here</a>.</p>
<p>B. <strong>Using Category Base Removal Plugin</strong></p>
<p>You can <a rel="nofollow" href="http://www.brianshoff.com/wordpress/category-base-removal-plugin.htm" target="_blank">download the Top level Categories here</a>.</p>
<p>2. <strong>Using PHP tag</strong>. I think you better use plugins, because it&#8217;s a lot easier. But in regard of sharing knowledge I post this way too.</p>
<p>1. Login to your WordPress via FTP, and go to <strong>category-template.php</strong>.<br />
2. And find this:</p>
<blockquote><p>
$catlink = str_replace(&#039;%category%&#039;, $category_nicename, $catlink);</p></blockquote>
<p>3. And put the following tag right beneath the above tag:</p>
<blockquote><p>$catlink = str_replace(&#039;category/&#039;, &#039;&#039;, $catlink);</p></blockquote>
<p>The tag within your category-template.php should look like the following image:</p>
<p style="text-align: center;"><a href="http://www.geocities.com/abi_bakars/categorywpurl.JPG" target="_blank"><img class="aligncenter" src="http://www.geocities.com/abi_bakars/categorywpurl.JPG" alt="category url in category-template.php" width="495" height="120" /></a></p>
<p>Click the image to have a bigger view.</p>
<p>And the last thing you need to do is change your permalink into this permalink structure (go to setting &#8211; &gt; permalink):</p>
<blockquote><p>%category%/%postname%</p></blockquote>
<p>.</p>
<p>Done!</p>
<p>There is also a problem if your current permalink structure is none as the above permalink. To resolve this you need a <a href="http://rumahabi.com/permalink-migration-plugins-to-permenantly-moved-ugly-permalinks-into-pretty-url.html"><strong>Permalink migration plugins</strong></a>. Go to this post because I&#8217;ve listed number of <a href="http://rumahabi.com/permalink-migration-plugins-to-permenantly-moved-ugly-permalinks-into-pretty-url.html"><strong>migration permalink plugins</strong></a>. Just wait:D. See you in the next post.</p>


<p>Related posts:<ol><li><a href='http://www.awesomewordpresstheme.com/how-to-shorten-wordpress-blog-post-url-for-twitter.html' rel='bookmark' title='Permanent Link: How To Shorten WordPress Blog Post URL For Twitter'>How To Shorten WordPress Blog Post URL For Twitter</a></li>
<li><a href='http://www.awesomewordpresstheme.com/wordpress-2-9-will-be-released-on-october-30.html' rel='bookmark' title='Permanent Link: WordPress 2.9 Will Be Released On October 30'>WordPress 2.9 Will Be Released On October 30</a></li>
<li><a href='http://www.awesomewordpresstheme.com/display-related-post-in-wordpress-without-plugin.html' rel='bookmark' title='Permanent Link: Display Related Post In WordPress Without Plugin'>Display Related Post In WordPress Without Plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.awesomewordpresstheme.com/delete-category-from-default-category-url.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
