<?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>iWP.me &#187; Theme Tips</title>
	<atom:link href="http://iwp.me/category/theme-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://iwp.me</link>
	<description>All that stuffs about WordPress and Web Design!</description>
	<lastBuildDate>Tue, 07 Oct 2008 14:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to display recent comments without plugin?</title>
		<link>http://iwp.me/how-to-display-recent-comments-without-plugin/</link>
		<comments>http://iwp.me/how-to-display-recent-comments-without-plugin/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 14:08:56 +0000</pubDate>
		<dc:creator>Chada</dc:creator>
				<category><![CDATA[Theme Tips]]></category>
		<category><![CDATA[Recent Comments]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://iwp.me/?p=35</guid>
		<description><![CDATA[After Display random posts without plugin and Display popular posts without plugin, I want to show you anther WordPress hack skill &#8211; display recent comments without plugin. Copy the codes below and paste them to your theme where you want &#8230; <a href="http://iwp.me/how-to-display-recent-comments-without-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After <em><a href="http://iwp.me/how-to-display-random-posts-without-plugin/">Display random posts without plugin</a></em> and <em><a href="http://iwp.me/how-to-display-popular-posts-without-plugin/">Display popular posts without plugin</a></em>, I want to show you anther WordPress hack  skill &#8211; display recent comments without plugin.</p>
<p style="text-align: center;"><img class="size-full wp-image-36 aligncenter" title="Display recent comments without pllugin" src="http://iwp.me/wp-content/uploads/2008/09/comments.gif" alt="" width="481" height="122" /><span id="more-35"></span></p>
<p>Copy the codes below and paste them to your theme where you want to display recent posts:</p>
<pre lang="php">				     < ?php
    global $wpdb;

    $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
    comment_post_ID, comment_author, comment_date_gmt, comment_approved,
    comment_type,comment_author_url,
    SUBSTRING(comment_content,1,30) AS com_excerpt
    FROM $wpdb-&gt;comments
    LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID =
    $wpdb-&gt;posts.ID)
    WHERE comment_approved = '1' AND comment_type = '' AND
    post_password = ''
    ORDER BY comment_date_gmt DESC
    LIMIT 10";
    $comments = $wpdb-&gt;get_results($sql);

    $output = $pre_HTML;
    $output .= "\n
<ul>";
    foreach ($comments as $comment) {

    $output .= "\n
<li>".strip_tags($comment-&gt;comment_author)
    .":" . "<a href="\">ID) .
    "#comment-" . $comment-&gt;comment_ID . "\" title=\"on " .
    $comment-&gt;post_title . "\"&gt;" . strip_tags($comment-&gt;com_excerpt)
    ."</a></li>

";

    }
    $output .= "\n
";
    $output .= $post_HTML;

    echo $output;?></pre>
<p>I hope this tip is useful for you!</p>
]]></content:encoded>
			<wfw:commentRss>http://iwp.me/how-to-display-recent-comments-without-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to display popular posts without plugin?</title>
		<link>http://iwp.me/how-to-display-popular-posts-without-plugin/</link>
		<comments>http://iwp.me/how-to-display-popular-posts-without-plugin/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 22:54:32 +0000</pubDate>
		<dc:creator>Chada</dc:creator>
				<category><![CDATA[Theme Tips]]></category>
		<category><![CDATA[Popular Posts]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://iwp.me/?p=18</guid>
		<description><![CDATA[The same as &#8220;How to display random posts without plugin&#8221;, you can also display polular posts without plugin. Copy codes below and paste to your theme: < ?php function popular_posts($no_posts = 5, $before = ' ', $after = '', $show_pass_post &#8230; <a href="http://iwp.me/how-to-display-popular-posts-without-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The same as &#8220;How to display random posts without plugin&#8221;, you can also display polular posts without plugin.</p>
<p><a href="http://None"><img class="aligncenter size-full wp-image-19" title="popular" src="http://iwp.me/wp-content/uploads/2008/09/popular.gif" alt="" width="481" height="122" /></a><span id="more-18"></span></p>
<p>Copy codes below and paste to your theme:</p>
<pre lang="php">< ?php function popular_posts($no_posts = 5, $before = '
<li>', $after = '', $show_pass_post = false, $duration='') {
global $wpdb;
$request = "SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'comment_count' FROM $wpdb->posts, $wpdb->comments";
$request .= " WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish'";
if(!$show_pass_post) $request .= " AND post_password =''";
if($duration !="") { $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";
}
$request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";
$posts = $wpdb->get_results($request);
$output = '';
if ($posts) {
foreach ($posts as $post) {
$post_title = stripslashes($post->post_title);
$comment_count = $post->comment_count;
$permalink = get_permalink($post->ID);
$output .= $before . '<a href="' . $permalink . '" title="' . $post_title.'">' . $post_title . '</a> (' . $comment_count.')' . $after;
}
} else {
$output .= $before . "None found" . $after;
}
echo $output;
} ?>
< ?php most_popular_posts(); ?>
</pre>
<p>You can change the number of posts you want to show by change the &#8220;5&#8243; in &#8220;$no_posts = 5&#8243;. Enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://iwp.me/how-to-display-popular-posts-without-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to display random posts without plugin?</title>
		<link>http://iwp.me/how-to-display-random-posts-without-plugin/</link>
		<comments>http://iwp.me/how-to-display-random-posts-without-plugin/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 14:47:36 +0000</pubDate>
		<dc:creator>Chada</dc:creator>
				<category><![CDATA[Theme Tips]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://iwp.me/?p=8</guid>
		<description><![CDATA[Yes there are so many plugins that can help you display random posts , But you know that plugins will slow down your WordPress blog. Here I want to show you how to dis play random posts without plugin. <a href="http://iwp.me/how-to-display-random-posts-without-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yes there are so many plugins that can help you display random posts , But you know that plugins will slow down your WordPress blog. Here I want to show you how to dis play random posts without plugin.</p>
<p><a href="http://Howtodisplayrandompostswithoutplugin"><img class="aligncenter size-full wp-image-21" title="random" src="http://iwp.me/wp-content/uploads/2008/09/random.gif" alt="" width="481" height="122" /></a></p>
<p>Just add the codes below to your sidebar or anywhere you want:</p>
<pre lang="php">
< ?php $rand_posts = get_posts('numberposts=5&#038;orderby=rand');
foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>">< ?php the_title(); ?></a></li>

< ?php endforeach; ?>
</pre>
<p>The 5 in the codes above is the numble of those posts will display. Yes, it is very easy!</p>
<p>[via <a href="http://codex.wordpress.org/Template_Tags/get_posts#Random_posts" target="_blank">WordPress Codex</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://iwp.me/how-to-display-random-posts-without-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
