<?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>WpFunc &#187; Related posts</title>
	<atom:link href="http://www.wpfunc.com/tag/related-posts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Fri, 09 Jul 2010 09:05:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Related Posts With Thumbnails</title>
		<link>http://www.wpfunc.com/wordpress/related-posts-with-thumbnails.html</link>
		<comments>http://www.wpfunc.com/wordpress/related-posts-with-thumbnails.html#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:51:20 +0000</pubDate>
		<dc:creator>KaiseRCrazY</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[Related posts]]></category>
		<category><![CDATA[tim thumb]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=396</guid>
		<description><![CDATA[We can add our related posts with thumnails after our content. There is a lot of plugin for that but we can do this without any plugin. But we need Tim Tumb for thumbnails. Let&#8217;s begin&#8230;
Here is The Code;
&#60;?php
$original_post = $post;
$tags = wp_get_post_tags($post-&#62;ID);
if ($tags) {
  echo '&#60;h2&#62;Related Posts&#60;/h2&#62;';
  $first_tag = $tags[0]-&#62;term_id;
  $args=array(
 [...]<hr /><div style="text-align:center;">
<a href="http://aweber.com/?339698" title="Email Marketing">
<img src="http://www.aweber.com/banners/email_marketing/468x60_an.gif" alt="Email Marketing $19/Month!" style="border:none;" /></a>
</div><hr />


Related posts:<ol><li><a href='http://www.wpfunc.com/general/related-posts-without-any-plugin.html' rel='bookmark' title='Permanent Link: Related Posts, Without any Plugin!'>Related Posts, Without any Plugin!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/simple-sticky-posts.html' rel='bookmark' title='Permanent Link: Simple Sticky Posts!'>Simple Sticky Posts!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/add-an-expration-date-for-posts.html' rel='bookmark' title='Permanent Link: Add an expration date for posts!'>Add an expration date for posts!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>We can add our related posts with thumnails after our content. There is a lot of plugin for that but we can do this without any plugin. But we need Tim Tumb for thumbnails. Let&#8217;s begin&#8230;<span id="more-396"></span></p>
<h3>Here is The Code;</h3>
<pre class="brush: php;">&lt;?php
$original_post = $post;
$tags = wp_get_post_tags($post-&gt;ID);
if ($tags) {
  echo '&lt;h2&gt;Related Posts&lt;/h2&gt;';
  $first_tag = $tags[0]-&gt;term_id;
  $args=array(
    'tag__in' =&gt; array($first_tag),
    'post__not_in' =&gt; array($post-&gt;ID),
    'showposts'=&gt;4,
    'caller_get_posts'=&gt;1
   );
  $my_query = new WP_Query($args);
  if( $my_query-&gt;have_posts() ) {
    echo &quot;&lt;ul&gt;&quot;;
    while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
      &lt;li&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/timthumb/timthumb.php?src=&lt;?php echo get_post_meta($post-&gt;ID, &quot;post-img&quot;, true); ?&gt;&amp;h=40&amp;w=40&amp;zc=1&quot; alt=&quot;&quot; /&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 endwhile;
    echo &quot;&lt;/ul&gt;&quot;;
  }
}
$post = $original_post;
wp_reset_query();
?&gt;</pre>
<p>Add this code after <strong>content</strong>. Look at <a href="http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/" target="_blank">Tim Thumb</a> at here. Have a nice day!</p>
<a rel='nofollow' target='_blank'  href='http://delicious.com/post?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;title=Related%20Posts%20With%20Thumbnails&amp;notes=We%20can%20add%20our%20related%20posts%20with%20thumnails%20after%20our%20content.%20There%20is%20a%20lot%20of%20plugin%20for%20that%20but%20we%20can%20do%20this%20without%20any%20plugin.%20But%20we%20need%20Tim%20Tumb%20for%20thumbnails.%20Let%27s%20begin...%0D%0AHere%20is%20The%20Code%3B%0D%0A%5Bphp%5D%26lt%3B%3Fphp%0D%0A%24original_post%20%3D%20%24post%3B%0D%0A%24t'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/delicious.png' class='sociable-img sociable-hovers ' title='del.icio.us' alt='del.icio.us' /></a><a rel='nofollow' target='_blank'  href='http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;title=Related%20Posts%20With%20Thumbnails&amp;bodytext=We%20can%20add%20our%20related%20posts%20with%20thumnails%20after%20our%20content.%20There%20is%20a%20lot%20of%20plugin%20for%20that%20but%20we%20can%20do%20this%20without%20any%20plugin.%20But%20we%20need%20Tim%20Tumb%20for%20thumbnails.%20Let%27s%20begin...%0D%0AHere%20is%20The%20Code%3B%0D%0A%5Bphp%5D%26lt%3B%3Fphp%0D%0A%24original_post%20%3D%20%24post%3B%0D%0A%24t'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/digg.png' class='sociable-img sociable-hovers ' title='Digg' alt='Digg' /></a><a rel='nofollow' target='_blank'  href='http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;t=Related%20Posts%20With%20Thumbnails'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/facebook.png' class='sociable-img sociable-hovers ' title='Facebook' alt='Facebook' /></a><a rel='nofollow' target='_blank'  href='http://www.friendfeed.com/share?title=Related%20Posts%20With%20Thumbnails&amp;link=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/friendfeed.png' class='sociable-img sociable-hovers ' title='FriendFeed' alt='FriendFeed' /></a><a rel='nofollow' target='_blank'  href='http://reddit.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;title=Related%20Posts%20With%20Thumbnails'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/reddit.png' class='sociable-img sociable-hovers ' title='Reddit' alt='Reddit' /></a><a rel='nofollow' target='_blank'  href='http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;title=Related%20Posts%20With%20Thumbnails'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png' class='sociable-img sociable-hovers ' title='StumbleUpon' alt='StumbleUpon' /></a><a rel='nofollow' target='_blank'  href='http://technorati.com/faves?add=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/technorati.png' class='sociable-img sociable-hovers ' title='Technorati' alt='Technorati' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/pdf.png' class='sociable-img sociable-hovers ' title='PDF' alt='PDF' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Frelated-posts-with-thumbnails.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/printfriendly.png' class='sociable-img sociable-hovers ' title='Print' alt='Print' /></a><br/><br/>

<p>Related posts:<ol><li><a href='http://www.wpfunc.com/general/related-posts-without-any-plugin.html' rel='bookmark' title='Permanent Link: Related Posts, Without any Plugin!'>Related Posts, Without any Plugin!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/simple-sticky-posts.html' rel='bookmark' title='Permanent Link: Simple Sticky Posts!'>Simple Sticky Posts!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/add-an-expration-date-for-posts.html' rel='bookmark' title='Permanent Link: Add an expration date for posts!'>Add an expration date for posts!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wpfunc.com/wordpress/related-posts-with-thumbnails.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Related Posts, Without any Plugin!</title>
		<link>http://www.wpfunc.com/general/related-posts-without-any-plugin.html</link>
		<comments>http://www.wpfunc.com/general/related-posts-without-any-plugin.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 08:00:47 +0000</pubDate>
		<dc:creator>KaiseRCrazY</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[recipe]]></category>
		<category><![CDATA[Related posts]]></category>
		<category><![CDATA[without plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=81</guid>
		<description><![CDATA[Hi everybody. You can show your related posts without any plugin. It&#8217;is important for visitors i think. Because they can discover your blog with that area. This code shows your same-tagged posts. Some plugins do this but why use plugin if you have a powerfull theme :). You can change posts number too. Lets Begin&#8230;

We [...]<hr /><div style="text-align:center;">
<a href="http://aweber.com/?339698" title="Email Marketing">
<img src="http://www.aweber.com/banners/email_marketing/468x60_an.gif" alt="Email Marketing $19/Month!" style="border:none;" /></a>
</div><hr />


Related posts:<ol><li><a href='http://www.wpfunc.com/wordpress/related-posts-with-thumbnails.html' rel='bookmark' title='Permanent Link: Related Posts With Thumbnails'>Related Posts With Thumbnails</a></li>
<li><a href='http://www.wpfunc.com/wordpress/popular-posts-without-any-plugin.html' rel='bookmark' title='Permanent Link: Popular Posts, Without any Plugin!'>Popular Posts, Without any Plugin!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/show-word-counts-on-your-posts.html' rel='bookmark' title='Permanent Link: Show word counts on your posts!'>Show word counts on your posts!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Hi everybody. You can show your related posts without any plugin. It&#8217;is important for visitors i think. Because they can discover your blog with that area. This code shows your same-tagged posts. Some plugins do this but why use plugin if you have a powerfull theme :). You can change posts number too. Lets Begin&#8230;<span id="more-81"></span></p>
<p style="text-align: justify;"><span class="attention"><strong>With this function/recipe you will change your core single.php file. If you have no information about WordPress coding -so you&#8217;re a newbie- you can get some support if you send a mail to me. Don&#8217;t touch your single.php if you don&#8217;t know about WordPress</strong></span></p>
<p style="text-align: justify;">We will change our themes <strong><em>single.php</em></strong>. Make bakcup and be careful. After backup open <strong>single.php</strong> and copy this code after loop or content.</p>
<h3>Here is the code;</h3>
<pre class="brush: plain;">&lt;?php
      //for use in the loop, list 5 post titles related to first tag on current post
      $tags = wp_get_post_tags($post-&gt;ID);
if ($tags) {
echo 'Related Posts';
$first_tag = $tags[0]-&gt;term_id;
$args=array(
'tag__in' =&gt; array($first_tag),
'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() ) {
while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
     &lt;p&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;/p&gt;
    &lt;?php
  endwhile;
  }
 }
?&gt; </pre>
<p>Save single.php. And then refresh your page. Related Posts are display after content. :) If you change &#8216;<em><strong>showpost=5</strong></em>&#8216; (<em><strong>the 5 is post number</strong></em>) 5 to 4,6,9,etc. Related posts number will change.</p>
<p>That&#8217;s All! Have a nice day!</p>
<a rel='nofollow' target='_blank'  href='http://delicious.com/post?url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;title=Related%20Posts%2C%20Without%20any%20Plugin%21&amp;notes=Hi%20everybody.%20You%20can%20show%20your%20related%20posts%20without%20any%20plugin.%20It%27is%20important%20for%20visitors%20i%20think.%20Because%20they%20can%20discover%20your%20blog%20with%20that%20area.%20This%20code%20shows%20your%20same-tagged%20posts.%20Some%20plugins%20do%20this%20but%20why%20use%20plugin%20if%20you%20have%20a%20'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/delicious.png' class='sociable-img sociable-hovers ' title='del.icio.us' alt='del.icio.us' /></a><a rel='nofollow' target='_blank'  href='http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;title=Related%20Posts%2C%20Without%20any%20Plugin%21&amp;bodytext=Hi%20everybody.%20You%20can%20show%20your%20related%20posts%20without%20any%20plugin.%20It%27is%20important%20for%20visitors%20i%20think.%20Because%20they%20can%20discover%20your%20blog%20with%20that%20area.%20This%20code%20shows%20your%20same-tagged%20posts.%20Some%20plugins%20do%20this%20but%20why%20use%20plugin%20if%20you%20have%20a%20'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/digg.png' class='sociable-img sociable-hovers ' title='Digg' alt='Digg' /></a><a rel='nofollow' target='_blank'  href='http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;t=Related%20Posts%2C%20Without%20any%20Plugin%21'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/facebook.png' class='sociable-img sociable-hovers ' title='Facebook' alt='Facebook' /></a><a rel='nofollow' target='_blank'  href='http://www.friendfeed.com/share?title=Related%20Posts%2C%20Without%20any%20Plugin%21&amp;link=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/friendfeed.png' class='sociable-img sociable-hovers ' title='FriendFeed' alt='FriendFeed' /></a><a rel='nofollow' target='_blank'  href='http://reddit.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;title=Related%20Posts%2C%20Without%20any%20Plugin%21'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/reddit.png' class='sociable-img sociable-hovers ' title='Reddit' alt='Reddit' /></a><a rel='nofollow' target='_blank'  href='http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;title=Related%20Posts%2C%20Without%20any%20Plugin%21'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png' class='sociable-img sociable-hovers ' title='StumbleUpon' alt='StumbleUpon' /></a><a rel='nofollow' target='_blank'  href='http://technorati.com/faves?add=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/technorati.png' class='sociable-img sociable-hovers ' title='Technorati' alt='Technorati' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/pdf.png' class='sociable-img sociable-hovers ' title='PDF' alt='PDF' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fgeneral%2Frelated-posts-without-any-plugin.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/printfriendly.png' class='sociable-img sociable-hovers ' title='Print' alt='Print' /></a><br/><br/>

<p>Related posts:<ol><li><a href='http://www.wpfunc.com/wordpress/related-posts-with-thumbnails.html' rel='bookmark' title='Permanent Link: Related Posts With Thumbnails'>Related Posts With Thumbnails</a></li>
<li><a href='http://www.wpfunc.com/wordpress/popular-posts-without-any-plugin.html' rel='bookmark' title='Permanent Link: Popular Posts, Without any Plugin!'>Popular Posts, Without any Plugin!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/show-word-counts-on-your-posts.html' rel='bookmark' title='Permanent Link: Show word counts on your posts!'>Show word counts on your posts!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wpfunc.com/general/related-posts-without-any-plugin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
