<?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>WordPress Hacks &#187; How-To</title>
	<atom:link href="http://wphacks.com/tag/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://wphacks.com</link>
	<description>WordPress Themes, Plugins, Hacks, Tutorials, and more!</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:20:21 +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>How To: Make your WordPress Search Results Unlimited</title>
		<link>http://wphacks.com/how-to-make-wordpress-search-results-unlimited/</link>
		<comments>http://wphacks.com/how-to-make-wordpress-search-results-unlimited/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 12:00:13 +0000</pubDate>
		<dc:creator>Leland</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Conditional Tags]]></category>
		<category><![CDATA[WordPress Code]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://wphacks.com/?p=516</guid>
		<description><![CDATA[This guest post was written by Leland of Theme Lab, where he has released over 50 WordPress themes. In addition to themes, Theme Lab also provides some WordPress guides. If you have WordPress knowledge and are interested in writing a post for Hack WordPress, please contact us. Sometimes you may not want your search results [...]]]></description>
			<content:encoded><![CDATA[<p><em>This guest post was written by Leland of <a href="http://www.themelab.com/">Theme Lab</a>, where he has released over 50 WordPress themes. In addition to themes, Theme Lab also provides some WordPress guides. If you have WordPress knowledge and are interested in <a href="http://wphacks.com/write">writing a post for Hack WordPress</a>, please <a href="http://wphacks.com/contact">contact us</a>.</em></p>
<p>Sometimes you may not want your search results to be limited by the confines of the standard <a href="http://www.themelab.com/2008/04/04/the-ultimate-guide-to-the-wordpress-loop/">WordPress Loop</a>. This is a quick code hack to allow a search to return unlimited results, altering the standard WordPress Loop by using a custom query. You can do this in a few different ways. If you have a search template, in <em>search.php</em> you can simple add the following line of code <strong>above</strong> your Loop.</p>
<p>Find:</p>
<p><code>&lt;?php if (have_posts()) : ?&gt;<br />
&lt;?php while (have_posts()) : the_post(); ?&gt;</code></p>
<p>Add:</p>
<p><code>&lt;?php $posts=query_posts($query_string . '&amp;posts_per_page=-1'); ?&gt;<br />
&lt;?php if (have_posts()) : ?&gt;<br />
&lt;?php while (have_posts()) : the_post(); ?&gt;</code></p>
<p>Make sure you put this code in your search.php only, unless you want unlimited posts on your index or archive pages. The <strong>-1</strong> you see can be changed to any positive integer to limit the posts to a number you choose as well.</p>
<p>If you don&#8217;t have a <em>search.php</em> in your theme, the next level down in the <a href="http://codex.wordpress.org/Template_Hierarchy#Search_Result_page">Template Hierarchy</a> is your <strong>Main Index Template</strong>, or <em>index.php</em>. You can use a conditional tag for the same effect.</p>
<p>For this we&#8217;ll use the same code as above, except wrap it in the <em>is_search()</em> conditional tag, like so:</p>
<p><code>&lt;?php if (is_search()) { $posts=query_posts($query_string . '&amp;posts_per_page=-1'); } ?&gt;<br />
&lt;?php if (have_posts()) : ?&gt;<br />
&lt;?php while (have_posts()) : the_post(); ?&gt;</code></p>
<p>You can use this technique to change the standard Loop limitations of archives, categories, tag pages, and even your main index template &#8211; but it would probably be easier to simply change your reading settings for that.</p>
<img src="http://wphacks.com/?ak_action=api_record_view&id=245&type=feed" alt="" /><p>You are reading <a href="http://wphacks.com/how-to-make-wordpress-search-results-unlimited/">How To: Make your WordPress Search Results Unlimited</a>  © 2008 | <a href="http://wphacks.com">WordPress Hacks</a> | <a href="http://wpnexus.com">WordPress Directory</a> | <a href="http://wpforums.com/">WordPress Forums</a> | <a href="http://wpebook.com/">WordPress eBook</a></p>

<p><small>Enjoy writing about WordPress?  Get your blog more exposure by joining the <a href="http://wphacks.com/write/">WordPress Hacks writing team</a>!</small></p>]]></content:encoded>
			<wfw:commentRss>http://wphacks.com/how-to-make-wordpress-search-results-unlimited/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How To: Separate WordPress Comments and Trackbacks</title>
		<link>http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/</link>
		<comments>http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 08:00:32 +0000</pubDate>
		<dc:creator>Kyle Eslick</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Code]]></category>
		<category><![CDATA[WordPress Comments]]></category>
		<category><![CDATA[WordPress Trackbacks]]></category>

		<guid isPermaLink="false">http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/</guid>
		<description><![CDATA[Note: For WordPress 2.7 and newer WordPress installations, you&#8217;ll instead want to use this tutorial. With all the WordPress themes available to WordPress users, it always surprises me how these incredible theme authors don&#8217;t take a few extra seconds to separate their theme&#8217;s trackbacks from the comments. It doesn&#8217;t look very professional and it can [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Note:</strong> For WordPress 2.7 and newer WordPress installations, you&#8217;ll instead want to use <a href="http://wphacks.com/separating-trackbacks-from-comments-in-wordpress-2-7/">this tutorial</a>. </em></p>
<p>With all the WordPress themes available to WordPress users, it always surprises me how these incredible theme authors don&#8217;t take a few extra seconds to separate their theme&#8217;s trackbacks from the comments. It doesn&#8217;t look very professional and it can make it extremely difficult to follow a conversation in the comments.</p>
<p>Separating your trackbacks and comments requires a minimal amount of coding work to set up. First, you&#8217;ll want to make a backup of your comments.php file just in case something goes wrong. Next, follow these three steps:</p>
<p>1 ) Access your comments.php file and locate the following code:</p>
<p><code>&lt;?php foreach ($comments as $comment) : ?&gt;</code></p>
<p>Immediately <strong>after</strong> the above code, you&#8217;ll want to place this code:</p>
<p><code>&lt;?php $comment_type = get_comment_type(); ?&gt;<br />
&lt;?php if($comment_type == 'comment') { ?&gt;</code></p>
<p>2 ) Next, you&#8217;ll want to scroll down a little bit and locate the following code:</p>
<p><code>&lt;?php endforeach; /* end for each comment */ ?&gt;</code></p>
<p>Immediately <strong>before</strong> the above code, you&#8217;ll want to place this code:</p>
<p><code>&lt;?php } /* End of is_comment statement */ ?&gt;</code></p>
<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.</p>
<p>3 ) Almost immediately below the code from step 2 you should find this code:</p>
<p><code>&lt;?php else : // this is displayed if there are no comments so far ?&gt;</code></p>
<p>Immediately <strong>before</strong> the above code, you&#8217;ll want to place this code:</p>
<p><code>&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 != 'comment') { ?&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;</code></p>
<p>You can adjust this code to display how you want to, including using a different header if you have a specific look for your header 3.</p>
<img src="http://wphacks.com/?ak_action=api_record_view&id=20&type=feed" alt="" /><p>You are reading <a href="http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/">How To: Separate WordPress Comments and Trackbacks</a>  © 2007 | <a href="http://wphacks.com">WordPress Hacks</a> | <a href="http://wpnexus.com">WordPress Directory</a> | <a href="http://wpforums.com/">WordPress Forums</a> | <a href="http://wpebook.com/">WordPress eBook</a></p>

<p><small>Enjoy writing about WordPress?  Get your blog more exposure by joining the <a href="http://wphacks.com/write/">WordPress Hacks writing team</a>!</small></p>]]></content:encoded>
			<wfw:commentRss>http://wphacks.com/how-to-separate-wordpress-comments-and-trackbacks/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
	</channel>
</rss>

