<?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>WooShift</title>
	<atom:link href="http://www.wooshift.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wooshift.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 09 Jun 2013 07:25:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Top 2 ways to display related posts in WordPress Without plugin</title>
		<link>http://www.wooshift.com/top-2-ways-to-display-related-posts-in-wordpress-without-plugin/</link>
		<comments>http://www.wooshift.com/top-2-ways-to-display-related-posts-in-wordpress-without-plugin/#comments</comments>
		<pubDate>Sun, 09 Jun 2013 07:24:00 +0000</pubDate>
		<dc:creator>Chunlinsay</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.wooshift.com/?p=8</guid>
		<description><![CDATA[There are many powerful plugins which you can use to list related posts on your WordPress site, for example,&#160; Related Posts、Simple Tags, yet-another-related-posts-plugin, and so on. I have used them repeatedly for many times , but eventually I quit them all because they are so &#8220;big&#8221; that my blog get slower than anytime before. Here [...]]]></description>
				<content:encoded><![CDATA[<p>There are many powerful plugins which you can use to list related posts on your WordPress site, for example,&nbsp; Related Posts、Simple Tags, yet-another-related-posts-plugin, and so on. I have used them repeatedly for many times , but eventually I quit them all because they are so &#8220;big&#8221; that my blog get slower than anytime before.
<p>Here are two metholds that you can use to list your related posts on your blog.</p>
<p><span id="more-8"></span><br />
<h4>The first method</h4>
<p>Display related posts in single post and Rss Feed.
<p>Drop the code into your theme&#8217;s <em>functions.php</em> file:</p>
<pre class="brush:php">function wp_get_related_posts()<br />{<br />global $wpdb, $post,$table_prefix;<br />$limit = 10; //How Many Related Posts Displayed<br />if(!$post-&gt;ID){return;}<br />$now = current_time('mysql', 1);<br />$tags = wp_get_post_tags($post-&gt;ID);<br />$taglist = "'" . $tags[0]-&gt;term_id. "'";<br />$tagcount = count($tags);<br />if ($tagcount &gt; 1) {<br />for ($i = 1; $i &lt; $tagcount; $i++) {<br />$taglist = $taglist . ", '" . $tags[$i]-&gt;term_id . "'";<br />}<br />}<br />$limitclause = "LIMIT $limit";<br />$q = "SELECT p.ID, p.post_title, p.post_date,&nbsp; p.comment_count, count(t_r.object_id) as cnt FROM $wpdb-&gt;term_taxonomy t_t, $wpdb-&gt;term_relationships t_r, $wpdb-&gt;posts p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id&nbsp; = p.ID AND (t_t.term_id IN ($taglist)) AND p.ID != $post-&gt;ID AND p.post_status = 'publish' AND p.post_date_gmt &lt; '$now' GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC $limitclause;";<br />$related_posts = $wpdb-&gt;get_results($q);<br />$output = "";<br />if (!$related_posts)<br />{<br />$output .= '&lt;li&gt;No Related Posts&lt;/li&gt;';<br />}<br />foreach ($related_posts as $related_post )<br />{<br />$dateformat = get_option('date_format');<br />$output .= '&lt;li&gt;';<br />$output .= '&lt;a href="'.get_permalink($related_post-&gt;ID).'" title="'.wptexturize($related_post-&gt;post_title).' ('.mysql2date($dateformat, $related_post-&gt;post_date).')"&gt;'.wptexturize($related_post-&gt;post_title).'&lt;/a&gt; ('.$related_post-&gt;comment_count .')';<br />$output .= '&lt;/li&gt;';<br />}<br />$output = '&lt;h3&gt;Related Posts&lt;/h3&gt;&lt;ul&gt;' . $output . '&lt;/ul&gt;';<br />return $output;<br />}<br />function wp_related_posts_attach($content)<br />{<br />if (is_single()||is_feed())<br />{<br />$output = wp_get_related_posts();<br />$content = $content . $output;<br />}<br />return $content;<br />}<br />add_filter('the_content', 'wp_related_posts_attach',100); </pre>
<h4>The second</h4>
<p>Display related posts only in single post.&nbsp;
<p>Insert the following code into your theme&#8217;s <em>single.php</em> file(usually after the line <em>&lt;?php the_content(); ?&gt;</em> ):</p>
<pre class="brush:php">&lt;h3&gt;Related Posts&lt;/h3&gt;<br />&lt;ul&gt;<br />&lt;?php<br />$tags = wp_get_post_tags($post-&gt;ID);<br />if ($tags) {<br />$first_tag = $tags[0]-&gt;term_id;<br />$args=array(<br />'tag__in' =&gt; array($first_tag),<br />'post__not_in' =&gt; array($post-&gt;ID),<br />'showposts'=&gt;10,//Display 10 related posts<br />'caller_get_posts'=&gt;1<br />);<br />$my_query = new WP_Query($args);<br />if( $my_query-&gt;have_posts() ) {<br />while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;<br />&lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?phpthe_title_attribute(); ?&gt;"&gt;&lt;?php the_title();?&gt; &lt;?php comments_number(' ','(1)','(%)'); ?&gt;&lt;/a&gt;&lt;/li&gt;<br />&lt;?php<br />endwhile;<br />}<br />}<br />wp_reset_query();<br />?&gt;<br />&lt;/ul&gt; </pre>
<p><a href="http://wange.im/related-posts-without-plugins-in-wordpress.html" target="_blank">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wooshift.com/top-2-ways-to-display-related-posts-in-wordpress-without-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 Ways To Add A Copyright Notice To Your WordPress Blog</title>
		<link>http://www.wooshift.com/4-ways-to-add-a-copyright-notice-to-your-wordpress-blog/</link>
		<comments>http://www.wooshift.com/4-ways-to-add-a-copyright-notice-to-your-wordpress-blog/#comments</comments>
		<pubDate>Sun, 09 Jun 2013 04:21:00 +0000</pubDate>
		<dc:creator>Chunlinsay</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Copyright]]></category>

		<guid isPermaLink="false">http://www.wooshift.com/?p=5</guid>
		<description><![CDATA[From a professional and branding standpoint, it is very important to display a copyright notice at the bottom of your WordPress blog. You can add it manually by using a piece of code that displays the current year. However, you also can choose to let WordPress to do this automatically. 1.The simplest but quickest way [...]]]></description>
				<content:encoded><![CDATA[<p>From a professional and branding standpoint, it is very important to display a copyright notice at the bottom of your WordPress blog. You can add it manually by using a piece of code that displays the current year. However, you also can choose to let WordPress to do this automatically.</p>
<p><span id="more-5"></span></p>
<h4>1.The simplest but quickest way</h4>
<p>Add this line below to your theme&#8217;s <em>footer.php</em> file：</p>
<pre class="brush:php">Copyright&amp;copy; 2011. &lt;a href=www.wooshift.com&gt;WooShift.Com&lt;/a&gt;</pre>
<p>You need to modify the date 2011 to what suits you.<br />
<strong>Output format</strong>：</p>
<blockquote><p>Copyright © 2011 WooShift.Com</p></blockquote>
<h4>2.using A php &#8220;date()&#8221; function</h4>
<p>Add this to the<em> footer.php</em> file:</p>
<pre class="brush:php">Copyright &amp;copy;&lt;?php echo date('Y'); ?&gt;.&lt;a href="&lt;?php echo get_option('home'); ?&gt;"&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;</pre>
<pre class="brush:php">Copyright &amp;copy;&lt;?php echo date('Y'); ?&gt;.&lt;a href="&lt;?php echo get_option('home'); ?&gt;"&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;</pre>
<p>This code above will automatically update your copyright date every year.<br />
<strong>Output format</strong>：</p>
<blockquote><p>Copyright © 2012 WooShift.Com</p></blockquote>
<h4>3.copyright notice from the year your blog started to the current year</h4>
<p>Add this to the<em> footer.php</em> file:</p>
<pre class="brush:php">Copyright &amp;copy; 2011-&lt;?php echo date('Y'); ?&gt;.&lt;a href="&lt;?php echo get_option('home'); ?&gt;"&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;</pre>
<p><strong>Output format</strong>：</p>
<blockquote><p>Copyright © 2011-2012 WooShift.Com</p></blockquote>
<h4>4.using functions.php file</h4>
<p>Open your theme&#8217;s <em>functions.php</em> file and insert the code below in it：</p>
<pre class="brush:php">function copyrightDate() {
	global $wpdb;
	$copyright_dates = $wpdb-&gt;get_results("
		SELECT 
			YEAR(min(post_date_gmt)) AS firstdate, 
			YEAR(max(post_date_gmt)) AS lastdate 
		FROM 
			$wpdb-&gt;posts
	");
	if($copyright_dates) {
		$copyright = "Copyright &amp;copy; " . $copyright_dates[0]-&gt;firstdate;
		if($copyright_dates[0]-&gt;firstdate != $copyright_dates[0]-&gt;lastdate) {
			$copyright .= '-' . $copyright_dates[0]-&gt;lastdate;
		}
		echo $copyright . "&amp;nbsp;" . get_bloginfo('name');
	}
}
add_filter('wp_footer', 'copyrightDate');</pre>
<p>Save the <em>functions.php</em> file and your copyright notice will automatically update every year.</p>
<p><strong>Output format</strong>：</p>
<blockquote><p>Copyright © 2011-2012 WooShift.Com</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.wooshift.com/4-ways-to-add-a-copyright-notice-to-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.wooshift.com/hello-world/</link>
		<comments>http://www.wooshift.com/hello-world/#comments</comments>
		<pubDate>Sun, 09 Jun 2013 02:34:28 +0000</pubDate>
		<dc:creator>Chunlinsay</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wooshift.com/wordpress/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
				<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wooshift.com/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
