<?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/"
		>
<channel>
	<title>Comments on: How to count posts in multiple categories for WordPress</title>
	<atom:link href="http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress</link>
	<description>Tips&#38;Tricks for the modern day web designer</description>
	<lastBuildDate>Wed, 01 Feb 2012 13:08:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Alexk</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1295</link>
		<dc:creator>Alexk</dc:creator>
		<pubDate>Wed, 01 Feb 2012 13:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1295</guid>
		<description>hello
thank you for your code,
I need a code for count posts joint in two categories , your way count all posts but I need only joint posts.

how can i do this ?</description>
		<content:encoded><![CDATA[<p>hello<br />
thank you for your code,<br />
I need a code for count posts joint in two categories , your way count all posts but I need only joint posts.</p>
<p>how can i do this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harsh maur</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1270</link>
		<dc:creator>Harsh maur</dc:creator>
		<pubDate>Mon, 19 Sep 2011 12:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1270</guid>
		<description>hey really found useful i was actually struck with the custom taxonomy count as it always showed published as well as drafts. I hope this code will work</description>
		<content:encoded><![CDATA[<p>hey really found useful i was actually struck with the custom taxonomy count as it always showed published as well as drafts. I hope this code will work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Job</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1257</link>
		<dc:creator>Job</dc:creator>
		<pubDate>Tue, 09 Aug 2011 13:26:23 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1257</guid>
		<description>If you want to do something similar but without poking around with SQL, you can use WordPress&#039; oqn query function to achieve the same result:

&lt;code&gt;
// $ids is an array of all IDs you want to check overlap of
function category_overlap_count($ids){
	$query = array();
	$query[&#039;category__and&#039;] = $ids; // This filters our query to include only posts that are in ALL of the specified queries
	$query[&#039;posts_per_page&#039;] = -1; // Making sure we select all posts (and not limit the query by our regular post per page setting)

	$results = get_posts( $query ); // Run the query

	$i = count($results); // Count the results

	return $i; // Return the count
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>If you want to do something similar but without poking around with SQL, you can use WordPress&#8217; oqn query function to achieve the same result:</p>
<p><code><br />
// $ids is an array of all IDs you want to check overlap of<br />
function category_overlap_count($ids){<br />
	$query = array();<br />
	$query['category__and'] = $ids; // This filters our query to include only posts that are in ALL of the specified queries<br />
	$query['posts_per_page'] = -1; // Making sure we select all posts (and not limit the query by our regular post per page setting)</p>
<p>	$results = get_posts( $query ); // Run the query</p>
<p>	$i = count($results); // Count the results</p>
<p>	return $i; // Return the count<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zdenek</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1246</link>
		<dc:creator>Zdenek</dc:creator>
		<pubDate>Sat, 16 Apr 2011 14:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1246</guid>
		<description>Very helpful. Thank you. Vielen Dank. Спасибо. ありがとうございます. Dekuji. Merci!</description>
		<content:encoded><![CDATA[<p>Very helpful. Thank you. Vielen Dank. Спасибо. ありがとうございます. Dekuji. Merci!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siniša</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1239</link>
		<dc:creator>Siniša</dc:creator>
		<pubDate>Tue, 18 Jan 2011 21:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1239</guid>
		<description>Nema frke, imenjače... Traži, traži, pa ćeš naći :)</description>
		<content:encoded><![CDATA[<p>Nema frke, imenjače&#8230; Traži, traži, pa ćeš naći :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sinisa</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1238</link>
		<dc:creator>Sinisa</dc:creator>
		<pubDate>Tue, 18 Jan 2011 13:35:25 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1238</guid>
		<description>Hvala brate, veoma je korisno. Ovo sam ganjao po celom netu.</description>
		<content:encoded><![CDATA[<p>Hvala brate, veoma je korisno. Ovo sam ganjao po celom netu.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: danielle</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1226</link>
		<dc:creator>danielle</dc:creator>
		<pubDate>Wed, 13 Oct 2010 15:43:59 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1226</guid>
		<description>thank you. thank you. thank you.</description>
		<content:encoded><![CDATA[<p>thank you. thank you. thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucius</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1205</link>
		<dc:creator>Lucius</dc:creator>
		<pubDate>Sun, 11 Jul 2010 21:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1205</guid>
		<description>Very useful, thank you very much!</description>
		<content:encoded><![CDATA[<p>Very useful, thank you very much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: courtenaya</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1182</link>
		<dc:creator>courtenaya</dc:creator>
		<pubDate>Mon, 10 May 2010 18:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1182</guid>
		<description>scale impact intensity gps</description>
		<content:encoded><![CDATA[<p>scale impact intensity gps</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: disney mp3 players</title>
		<link>http://webdosanddonts.com/how-to-count-posts-in-multiple-categories-for-wordpress/comment-page-1#comment-1122</link>
		<dc:creator>disney mp3 players</dc:creator>
		<pubDate>Fri, 26 Feb 2010 10:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://webdosanddonts.com/?p=581#comment-1122</guid>
		<description>Nice post. Love your work hope to see some more cool stuff soon.</description>
		<content:encoded><![CDATA[<p>Nice post. Love your work hope to see some more cool stuff soon.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

