<?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: WordPress 3.1: Advanced Taxonomy Queries</title>
	<atom:link href="http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/</link>
	<description>You have to use an Ottopress to get fresh squeezed Otto.</description>
	<lastBuildDate>Fri, 17 May 2013 22:57:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-beta2-24237</generator>
	<item>
		<title>By: valuser</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11831</link>
		<dc:creator>valuser</dc:creator>
		<pubDate>Mon, 13 May 2013 11:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11831</guid>
		<description><![CDATA[Many thanks for really comprehensive posts!

Is it possible to use the Operator &#039;Not In&#039; with &#039;taxonomy&#039; =&gt; &#039;post_tag&#039;. It appears to work perfectly with categories.

Have tried to add the following (not a coder) to functions.php but i just get white screen. 


[php]function xclude_tag($query) {
if ( $query-&gt;is_home ) {
$query-&gt;set(array(
          &#039;taxonomy&#039; =&gt; &#039;post_tag&#039;,
	&#039;field&#039; =&gt; &#039;slug&#039;,
          &#039;terms&#039; =&gt; array(&#039;xhidex&#039;),
          &#039;operator&#039; =&gt; &#039;NOT IN&#039;
        )
)
}
  return $query;
}
add_filter(&#039;pre_get_posts&#039;, &#039;xclude_tag&#039;);[/php]


Any obervations most welcome!]]></description>
		<content:encoded><![CDATA[<p>Many thanks for really comprehensive posts!</p>
<p>Is it possible to use the Operator &#8216;Not In&#8217; with &#8216;taxonomy&#8217; =&gt; &#8216;post_tag&#8217;. It appears to work perfectly with categories.</p>
<p>Have tried to add the following (not a coder) to functions.php but i just get white screen. </p>
<pre class="brush: php; title: ; notranslate">function xclude_tag($query) {
if ( $query-&gt;is_home ) {
$query-&gt;set(array(
          'taxonomy' =&gt; 'post_tag',
	'field' =&gt; 'slug',
          'terms' =&gt; array('xhidex'),
          'operator' =&gt; 'NOT IN'
        )
)
}
  return $query;
}
add_filter('pre_get_posts', 'xclude_tag');</pre>
<p>Any obervations most welcome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sdesign</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11808</link>
		<dc:creator>Sdesign</dc:creator>
		<pubDate>Thu, 25 Apr 2013 16:59:03 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11808</guid>
		<description><![CDATA[Does the pre_get_post alow for pagination? I am having a hard time figuring out how to set up the code using the pre_get_post to try it out

Thank you]]></description>
		<content:encoded><![CDATA[<p>Does the pre_get_post alow for pagination? I am having a hard time figuring out how to set up the code using the pre_get_post to try it out</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11807</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Thu, 25 Apr 2013 16:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11807</guid>
		<description><![CDATA[Pagination doesn&#039;t work because you&#039;re using query_posts. There&#039;s better ways to change the main post query, like using the pre_get_posts filter: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts]]></description>
		<content:encoded><![CDATA[<p>Pagination doesn&#8217;t work because you&#8217;re using query_posts. There&#8217;s better ways to change the main post query, like using the pre_get_posts filter: <a href="http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts" rel="nofollow">http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sdesign</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11803</link>
		<dc:creator>sdesign</dc:creator>
		<pubDate>Wed, 24 Apr 2013 15:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11803</guid>
		<description><![CDATA[I am trying to show posts from posts within one category as well as several other post types from withing one category all on one page. I have the below code and it works but pagination does not work any help would be appreciated.

 &#039;OR&#039;,
    array(
        &#039;taxonomy&#039; =&gt; &#039;category&#039;,
        &#039;terms&#039; =&gt; array(&#039;outdoor-recreation&#039;),
        &#039;field&#039; =&gt; &#039;slug&#039;,
    ),
    array(
        &#039;taxonomy&#039; =&gt; &#039;outtake_category&#039;,
        &#039;terms&#039; =&gt; array(&#039;outdoor-recreation&#039;),
        &#039;field&#039; =&gt; &#039;slug&#039;,
    ),
	array(
        &#039;taxonomy&#039; =&gt; &#039;story_category&#039;,
        &#039;terms&#039; =&gt; array(&#039;outdoor-recreation&#039;),
        &#039;field&#039; =&gt; &#039;slug&#039;,
    ),
);
query_posts($myquery);
?&gt;


	

		&lt;div  id=&quot;post-&quot;&gt;
        							


&lt;h2 id=&quot;post-&quot;&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;



&lt;?php
if ( has_post_thumbnail()) {
  echo &#039;&lt;a&gt;ID) . &#039;&quot; &gt;&#039;;
  the_post_thumbnail();
  echo &#039;&lt;/a&gt;&#039;;
}
?&gt;&lt;!-- end featured image --&gt;
					
                    
						
					]]></description>
		<content:encoded><![CDATA[<p>I am trying to show posts from posts within one category as well as several other post types from withing one category all on one page. I have the below code and it works but pagination does not work any help would be appreciated.</p>
<p> &#8216;OR&#8217;,<br />
    array(<br />
        &#8216;taxonomy&#8217; =&gt; &#8216;category&#8217;,<br />
        &#8216;terms&#8217; =&gt; array(&#8216;outdoor-recreation&#8217;),<br />
        &#8216;field&#8217; =&gt; &#8216;slug&#8217;,<br />
    ),<br />
    array(<br />
        &#8216;taxonomy&#8217; =&gt; &#8216;outtake_category&#8217;,<br />
        &#8216;terms&#8217; =&gt; array(&#8216;outdoor-recreation&#8217;),<br />
        &#8216;field&#8217; =&gt; &#8216;slug&#8217;,<br />
    ),<br />
	array(<br />
        &#8216;taxonomy&#8217; =&gt; &#8216;story_category&#8217;,<br />
        &#8216;terms&#8217; =&gt; array(&#8216;outdoor-recreation&#8217;),<br />
        &#8216;field&#8217; =&gt; &#8216;slug&#8217;,<br />
    ),<br />
);<br />
query_posts($myquery);<br />
?&gt;</p>
<p>		&lt;div  id=&#8221;post-&#8221;&gt;</p>
<p>&lt;h2 id=&quot;post-&#8221;&gt;&lt;a href=&quot;&#8221;&gt;</p>
<p>&lt;?php<br />
if ( has_post_thumbnail()) {<br />
  echo &#039;<a>ID) . &#8216;&#8221; &gt;&#8217;;<br />
  the_post_thumbnail();<br />
  echo &#8216;</a>&#8216;;<br />
}<br />
?&gt;<!-- end featured image --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claudiu</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11756</link>
		<dc:creator>Claudiu</dc:creator>
		<pubDate>Tue, 09 Apr 2013 17:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11756</guid>
		<description><![CDATA[Hi Otto

How can I implement a multiple search plugin if I have more than 4 taxonomy types and I&#039;d like to be able to select a few taxonomies from first type and use AND operator, a few from second type and use OR operator and from the 4th to have again AND operator and between all taxonomy types to have an AND operator. Is that possible. I&#039;m asking because as I can see, only one array is used to manage multiple taxonomies and IN operator is not useful enough for my needs.

Thank you]]></description>
		<content:encoded><![CDATA[<p>Hi Otto</p>
<p>How can I implement a multiple search plugin if I have more than 4 taxonomy types and I&#8217;d like to be able to select a few taxonomies from first type and use AND operator, a few from second type and use OR operator and from the 4th to have again AND operator and between all taxonomy types to have an AND operator. Is that possible. I&#8217;m asking because as I can see, only one array is used to manage multiple taxonomies and IN operator is not useful enough for my needs.</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adem</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11710</link>
		<dc:creator>Adem</dc:creator>
		<pubDate>Mon, 18 Mar 2013 22:11:04 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11710</guid>
		<description><![CDATA[Hey Otto,

I&#039;ve got a custom post type for training courses. For those courses I&#039;ve got taxonomies of &quot;qualification-level&quot;, &quot;training-country&quot; and &quot;worker-cardre&quot;.

I&#039;m trying to retrieve posts based on a keyword that matches in any of the taxonomies

eg. for the keyword of &quot;Australia&quot; it should return posts that match &quot;Australia&quot; for &quot;qualification-level&quot; OR &quot;training-country&quot; OR &quot;worker-cardre&quot;. The code I&#039;m using for the tax_query is below:

&lt;code&gt;
$args = array();
$args[&#039;post_type&#039;] = &quot;training&quot;;
$args[&#039;showposts&#039;] = 15;
$args[&#039;paged&#039;] = $paged;
$args[&#039;orderby&#039;] = &quot;title&quot;;
$args[&#039;order&#039;] = &quot;ASC&quot;; 
if( ! empty( $_SESSION[&#039;keywords&#039;] ) ) {
    $args[&#039;tax_query&#039;] = array(
    &#039;relation&#039; =&gt; &#039;OR&#039;,
    array(
    &#039;taxonomy&#039; =&gt; &#039;qualification-level&#039;,
    &#039;terms&#039; =&gt; array($_SESSION[&#039;keywords&#039;]),
    &#039;field&#039; =&gt; &#039;slug&#039;,
    ),
    array(
    &#039;taxonomy&#039; =&gt; &#039;training-country&#039;,
    &#039;terms&#039; =&gt; array($_SESSION[&#039;keywords&#039;]),
    &#039;field&#039; =&gt; &#039;slug&#039;,
    ),  
    array(
    &#039;taxonomy&#039; =&gt; &#039;worker-cadre&#039;,
    &#039;terms&#039; =&gt; array($_SESSION[&#039;keywords&#039;]),
    &#039;field&#039; =&gt; &#039;slug&#039;,
    ),
    );
}
$search_query = new WP_Query($args);
&lt;/code&gt;

t is currently returning all results, even those that don&#039;t match the keyword (eg, Vietnam).

I&#039;ve also tried with the &lt;code&gt;&#039;operator&#039; =&gt; &#039;IN&#039;&lt;/code&gt; for each but that doesn&#039;t seem to work either (still shows all results)

Any chance you can help?

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Hey Otto,</p>
<p>I&#8217;ve got a custom post type for training courses. For those courses I&#8217;ve got taxonomies of &#8220;qualification-level&#8221;, &#8220;training-country&#8221; and &#8220;worker-cardre&#8221;.</p>
<p>I&#8217;m trying to retrieve posts based on a keyword that matches in any of the taxonomies</p>
<p>eg. for the keyword of &#8220;Australia&#8221; it should return posts that match &#8220;Australia&#8221; for &#8220;qualification-level&#8221; OR &#8220;training-country&#8221; OR &#8220;worker-cardre&#8221;. The code I&#8217;m using for the tax_query is below:</p>
<p><code><br />
$args = array();<br />
$args['post_type'] = "training";<br />
$args['showposts'] = 15;<br />
$args['paged'] = $paged;<br />
$args['orderby'] = "title";<br />
$args['order'] = "ASC";<br />
if( ! empty( $_SESSION['keywords'] ) ) {<br />
    $args['tax_query'] = array(<br />
    'relation' =&gt; 'OR',<br />
    array(<br />
    'taxonomy' =&gt; 'qualification-level',<br />
    'terms' =&gt; array($_SESSION['keywords']),<br />
    'field' =&gt; 'slug',<br />
    ),<br />
    array(<br />
    'taxonomy' =&gt; 'training-country',<br />
    'terms' =&gt; array($_SESSION['keywords']),<br />
    'field' =&gt; 'slug',<br />
    ),<br />
    array(<br />
    'taxonomy' =&gt; 'worker-cadre',<br />
    'terms' =&gt; array($_SESSION['keywords']),<br />
    'field' =&gt; 'slug',<br />
    ),<br />
    );<br />
}<br />
$search_query = new WP_Query($args);<br />
</code></p>
<p>t is currently returning all results, even those that don&#8217;t match the keyword (eg, Vietnam).</p>
<p>I&#8217;ve also tried with the <code>'operator' =&gt; 'IN'</code> for each but that doesn&#8217;t seem to work either (still shows all results)</p>
<p>Any chance you can help?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11632</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Fri, 15 Feb 2013 19:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11632</guid>
		<description><![CDATA[Just in case you or anyone else runs into this issue: I found a solution, although rather inelegant and not something I&#039;d like to use long term. Submitted to github here:

https://github.com/Automattic/Co-Authors-Plus/issues/107]]></description>
		<content:encoded><![CDATA[<p>Just in case you or anyone else runs into this issue: I found a solution, although rather inelegant and not something I&#8217;d like to use long term. Submitted to github here:</p>
<p><a href="https://github.com/Automattic/Co-Authors-Plus/issues/107" rel="nofollow">https://github.com/Automattic/Co-Authors-Plus/issues/107</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11631</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Fri, 15 Feb 2013 00:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11631</guid>
		<description><![CDATA[Thanks for the quick response, I appreciate it. Good call on the var_dump, however... I&#039;m still in the same situation, if not more confused. I checked the output for every author on the site and the SQL is there for all but two of them. I have double-checked to make sure that there are entries that would show up for the specified query, but still nothing. I&#039;ve also just realized that tax_query for the author taxonomy using $curauth-&gt;user_login actually doesn&#039;t work at all for these two, but it does for everyone else.

So, I&#039;ve now narrowed it down to the fact that $curauth-&gt;user_login doesn&#039;t work once the query starts for just these two users.

Have you ever seen an issue with slug length and tax_query? Otherwise... I&#039;m at a loss.

Here are the pages if this piques your curiosity:

&lt;a href=&quot;http://sandbox.theagencyre.com/agent/hana-cha/&quot; rel=&quot;nofollow&quot;&gt;Not Working&lt;/a&gt;
&lt;a href=&quot;http://sandbox.theagencyre.com/agent/edward-fitz/&quot; rel=&quot;nofollow&quot;&gt;Not Working&lt;/a&gt;

&lt;a href=&quot;http://sandbox.theagencyre.com/agent/alejandro-aldrete/&quot; rel=&quot;nofollow&quot;&gt;Working&lt;/a&gt;
&lt;a href=&quot;http://sandbox.theagencyre.com/agent/mauricio-umansky/&quot; rel=&quot;nofollow&quot;&gt;Working&lt;/a&gt;

Again, I appreciate your time.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the quick response, I appreciate it. Good call on the var_dump, however&#8230; I&#8217;m still in the same situation, if not more confused. I checked the output for every author on the site and the SQL is there for all but two of them. I have double-checked to make sure that there are entries that would show up for the specified query, but still nothing. I&#8217;ve also just realized that tax_query for the author taxonomy using $curauth-&gt;user_login actually doesn&#8217;t work at all for these two, but it does for everyone else.</p>
<p>So, I&#8217;ve now narrowed it down to the fact that $curauth-&gt;user_login doesn&#8217;t work once the query starts for just these two users.</p>
<p>Have you ever seen an issue with slug length and tax_query? Otherwise&#8230; I&#8217;m at a loss.</p>
<p>Here are the pages if this piques your curiosity:</p>
<p><a href="http://sandbox.theagencyre.com/agent/hana-cha/" rel="nofollow">Not Working</a><br />
<a href="http://sandbox.theagencyre.com/agent/edward-fitz/" rel="nofollow">Not Working</a></p>
<p><a href="http://sandbox.theagencyre.com/agent/alejandro-aldrete/" rel="nofollow">Working</a><br />
<a href="http://sandbox.theagencyre.com/agent/mauricio-umansky/" rel="nofollow">Working</a></p>
<p>Again, I appreciate your time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11630</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Thu, 14 Feb 2013 23:45:30 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11630</guid>
		<description><![CDATA[Do a var_dump on the $query after you create it, then look at the actual SQL it generates. It&#039;s easier to debug something that way than to try to guess at what it&#039;s doing.]]></description>
		<content:encoded><![CDATA[<p>Do a var_dump on the $query after you create it, then look at the actual SQL it generates. It&#8217;s easier to debug something that way than to try to guess at what it&#8217;s doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/comment-page-2/#comment-11628</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Thu, 14 Feb 2013 23:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://ottopress.com/?p=331#comment-11628</guid>
		<description><![CDATA[Hey Otto - Hopefully you&#039;re still monitoring this (and thanks for all the amazing work you do in the Wordpress community). I&#039;m having issues with a custom taxonomy query. Essentially, what I&#039;m trying to do is execute a query for all entries into a custom post type by a specific author and with a specific tag on their author.php template. I&#039;m using the Co-Authors Plus plugin and the author suggested using tax_query to pull author specific posts, but when combined with another taxonomy it just fails. Here is what I&#039;d like to accomplish:
[php]$args = array(
	&#039;post_type&#039; =&gt; array(
		                    &#039;sale&#039;,
		                    &#039;lease&#039;
	                		),
	&#039;tax_query&#039; =&gt; array(
							array(
								&#039;taxonomy&#039; =&gt; &#039;author&#039;,
								&#039;field&#039; =&gt; &#039;slug&#039;,
								&#039;terms&#039; =&gt; $curauth-&gt;user_login
							),
							array(
					          &#039;taxonomy&#039; =&gt; &#039;post_tag&#039;,
					          &#039;field&#039; =&gt; &#039;slug&#039;,
					          &#039;terms&#039; =&gt; array(&#039;sold&#039;)
					        )
						),
);
$query = new WP_Query( $args ); while($query-&gt;have_posts()) : $query-&gt;the_post();[/php]

From what I understand, this should pull all entries from those custom post types by the current author with that specific tag. It works if I remove the author tax_query and vice versa, but not together. I&#039;ve even tried using simple parameters in the main query like [php]&#039;tag&#039; =&gt; &#039;sold&#039;[/php] and [php]&#039;tag__in&#039; =&gt; array(34)[/php] but those do not work either when combined with the author taxonomy.

Any thoughts?]]></description>
		<content:encoded><![CDATA[<p>Hey Otto &#8211; Hopefully you&#8217;re still monitoring this (and thanks for all the amazing work you do in the WordPress community). I&#8217;m having issues with a custom taxonomy query. Essentially, what I&#8217;m trying to do is execute a query for all entries into a custom post type by a specific author and with a specific tag on their author.php template. I&#8217;m using the Co-Authors Plus plugin and the author suggested using tax_query to pull author specific posts, but when combined with another taxonomy it just fails. Here is what I&#8217;d like to accomplish:</p>
<pre class="brush: php; title: ; notranslate">$args = array(
	'post_type' =&gt; array(
		                    'sale',
		                    'lease'
	                		),
	'tax_query' =&gt; array(
							array(
								'taxonomy' =&gt; 'author',
								'field' =&gt; 'slug',
								'terms' =&gt; $curauth-&gt;user_login
							),
							array(
					          'taxonomy' =&gt; 'post_tag',
					          'field' =&gt; 'slug',
					          'terms' =&gt; array('sold')
					        )
						),
);
$query = new WP_Query( $args ); while($query-&gt;have_posts()) : $query-&gt;the_post();</pre>
<p>From what I understand, this should pull all entries from those custom post types by the current author with that specific tag. It works if I remove the author tax_query and vice versa, but not together. I&#8217;ve even tried using simple parameters in the main query like
<pre class="brush: php; title: ; notranslate">'tag' =&gt; 'sold'</pre>
<p> and
<pre class="brush: php; title: ; notranslate">'tag__in' =&gt; array(34)</pre>
<p> but those do not work either when combined with the author taxonomy.</p>
<p>Any thoughts?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Object Caching 429/446 objects using xcache

 Served from: ottodestruct.com @ 2013-05-18 01:43:08 by W3 Total Cache -->