<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:media="http://search.yahoo.com/mrss/"	>
<channel>
	<title>Comments on: Display Search Term and Result Count in WordPress</title>
	<atom:link href="http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/</link>
	<description>Beginner&#039;s Guide for WordPress</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:04:12 +0000</lastBuildDate>
	<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>By: chadhayton</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-123508</link>
		<dc:creator>chadhayton</dc:creator>
		<pubDate>Sun, 02 Oct 2011 03:53:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-123508</guid>
		<description>It is hard to tell how old this post is, but WordPress 3.1 includes a way to get the total search results that doesn&#039;t require a separate query:

http://codex.wordpress.org/Creating_a_Search_Page#Display_Total_Results</description>
		<content:encoded><![CDATA[<p>It is hard to tell how old this post is, but WordPress 3.1 includes a way to get the total search results that doesn&#8217;t require a separate query:</p>
<p><a href="http://codex.wordpress.org/Creating_a_Search_Page#Display_Total_Results" rel="nofollow">http://codex.wordpress.org/Creating_a_Search_Page#Display_Total_Results</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-40310</link>
		<dc:creator>Ilya</dc:creator>
		<pubDate>Tue, 05 Oct 2010 09:35:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-40310</guid>
		<description>Chris,

This won&#039;t work. The point is to find out the total number of results matching the query -- not the number currently fetched. If there are more results than &quot;fits&quot; within a page, your code will only get number of elements on a page.</description>
		<content:encoded><![CDATA[<p>Chris,</p>
<p>This won&#8217;t work. The point is to find out the total number of results matching the query &#8212; not the number currently fetched. If there are more results than &#8220;fits&#8221; within a page, your code will only get number of elements on a page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Editorial Staff</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-32156</link>
		<dc:creator>Editorial Staff</dc:creator>
		<pubDate>Fri, 20 Aug 2010 00:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-32156</guid>
		<description>Your code is cut off a little. Is there a way that you can email us the snippet and we can try it and write about it. Obviously full credit will be given to you.</description>
		<content:encoded><![CDATA[<p>Your code is cut off a little. Is there a way that you can email us the snippet and we can try it and write about it. Obviously full credit will be given to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Murphy</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-32116</link>
		<dc:creator>Chris Murphy</dc:creator>
		<pubDate>Thu, 19 Aug 2010 19:31:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-32116</guid>
		<description>Wow. It&#039;s a lot simpler than that to count WordPress&#039; search results, here:

[code]
    global $wp_query;
    $count = sizeof( $wp_query-&gt;posts );
    echo&quot;&lt;pre&gt;&quot;;
    //var_dump($wp_query);// The WP Query Object
    var_dump($wp_query-&gt;posts); // The WP Query Object&#039;s &#039;posts&#039; property (note the plural)
    echo&quot;&lt;/pre&gt;&quot;;
[/code]

If you drop that snippet in your search template, it will output the properties of the &#039;$wp_query&#039; variable, specifically the &#039;posts&#039; property of the object. This is an array that stores a collection of the returned posts from the search query, which you can do a number of things with once you access it, including (*drumroll*), *count* the number of posts in that array using either PHP&#039;s &#039;count()&#039; or &#039;sizeof()&#039; functio</description>
		<content:encoded><![CDATA[<p>Wow. It&#8217;s a lot simpler than that to count WordPress&#8217; search results, here:</p>
<pre class="brush: plain; title: ; notranslate">
    global $wp_query;
    $count = sizeof( $wp_query-&gt;posts );
    echo&quot;&lt;pre&gt;&quot;;
    //var_dump($wp_query);// The WP Query Object
    var_dump($wp_query-&gt;posts); // The WP Query Object's 'posts' property (note the plural)
    echo&quot;&lt;/pre&gt;&quot;;
</pre>
<p>If you drop that snippet in your search template, it will output the properties of the &#8216;$wp_query&#8217; variable, specifically the &#8216;posts&#8217; property of the object. This is an array that stores a collection of the returned posts from the search query, which you can do a number of things with once you access it, including (*drumroll*), *count* the number of posts in that array using either PHP&#8217;s &#8216;count()&#8217; or &#8216;sizeof()&#8217; functio</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pete</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-9329</link>
		<dc:creator>pete</dc:creator>
		<pubDate>Thu, 18 Feb 2010 15:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-9329</guid>
		<description>Search results are a personal thing from a user so it&#039;s good if they are given lots of info for them.</description>
		<content:encoded><![CDATA[<p>Search results are a personal thing from a user so it&#8217;s good if they are given lots of info for them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Editorial Staff</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-9208</link>
		<dc:creator>Editorial Staff</dc:creator>
		<pubDate>Tue, 16 Feb 2010 14:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-9208</guid>
		<description>This code is correct. It works, the only issue he is pointing out is that it can be done differently as well. We have used this code on a client&#039;s website and it works.</description>
		<content:encoded><![CDATA[<p>This code is correct. It works, the only issue he is pointing out is that it can be done differently as well. We have used this code on a client&#8217;s website and it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: basilakis</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-9207</link>
		<dc:creator>basilakis</dc:creator>
		<pubDate>Tue, 16 Feb 2010 14:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-9207</guid>
		<description>So the code is right or not? :)

I see Konstantin has some point about the query, but the comments &quot;ate&quot; the results! :D</description>
		<content:encoded><![CDATA[<p>So the code is right or not? <img src='http://cdn.wpbeginner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I see Konstantin has some point about the query, but the comments &#8220;ate&#8221; the results! <img src='http://cdn.wpbeginner.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WordPress Picks for the week [02/10] &#124; Techtites</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-8832</link>
		<dc:creator>WordPress Picks for the week [02/10] &#124; Techtites</dc:creator>
		<pubDate>Wed, 10 Feb 2010 19:04:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-8832</guid>
		<description>[...] Display Search Term and Result Count in WordPress [...]</description>
		<content:encoded><![CDATA[<p>[...] Display Search Term and Result Count in WordPress [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konstantin</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-8810</link>
		<dc:creator>Konstantin</dc:creator>
		<pubDate>Wed, 10 Feb 2010 08:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-8810</guid>
		<description>Good idea. Bad execution.
Why in the world would you want to translate a span tag???
And my favorite: &lt;code&gt;_e(&#039;&#039;);&lt;/code&gt; Huh??
Why would you want to query the same search twice?
Doesn&#039;t make sense at all.

But I don&#039;t want to hate, this is how it should be done (in my humble opinion):

&lt;code&gt;
post_count); ?&gt;

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Good idea. Bad execution.<br />
Why in the world would you want to translate a span tag???<br />
And my favorite: <code>_e('');</code> Huh??<br />
Why would you want to query the same search twice?<br />
Doesn&#8217;t make sense at all.</p>
<p>But I don&#8217;t want to hate, this is how it should be done (in my humble opinion):</p>
<p><code><br />
post_count); ?&gt;</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.wpbeginner.com/wp-tutorials/display-search-term-and-result-count-in-wordpress/comment-page-1/#comment-8801</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Tue, 09 Feb 2010 21:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.wpbeginner.com/?p=1239#comment-8801</guid>
		<description>I really don&#039;t give my on page search enough thought. Something like this is great because it makes the page more personalised.</description>
		<content:encoded><![CDATA[<p>I really don&#8217;t give my on page search enough thought. Something like this is great because it makes the page more personalised.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Content Delivery Network via cdn.wpbeginner.com

Served from: www.wpbeginner.com @ 2012-02-09 23:57:05 -->
