1
vote
0answers
50 views

WP_Query tax_query problem

When I call WP_Query with tax query or category__in, I get posts only from first category in array of requested categories. $query = new WP_Query( array( "tax_query" => array( ...
2
votes
1answer
29 views

Hiding taxonomies with no children WP_Query & tax_query

I have this code which has taken over 7 hours to put together through research but the last hours or so I have hit a brick wall! I require the taxonomy title to be hidden if there are no posts ...
1
vote
2answers
41 views

Including all terms in wordpress tax_query

I'm a little bit confused, why I can't include all the terms in tax_query automatically? My code: 'tax_query' => array( array( 'taxonomy' => 'city', 'field' => 'slug', ...
0
votes
0answers
23 views

How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?

I just encountered a problem and realized that all tags must be globally unique. Here is what just happened to me: I created a taxonomy called writer and added each author and collaborator to the ...
0
votes
0answers
29 views

wordpress page filter problems

Hello I been working on post type filter so I can filter my content for taxonomies type but for what ever reason I can never get it to filter when I click filter public function product_filters( ...
0
votes
1answer
97 views

WP_Query tax_query - Show results if child has parent X

I've made a custom search which includes a 3 tier custom taxonomy that looks like this: continent - country - - state The search is formatting in the above way. Here is my problem: Example data: ...
0
votes
1answer
116 views

how to use tax_query to apply both terms or one if one is empty

I'm having trouble with getting tax_query to act as a filter for posts. What I would like is to have it so it will display cpt's that have the terms of county and status but also work if terms are not ...
1
vote
1answer
549 views

Why is my WP_Query not working when tax_query terms are an array?

I have an issue with a WP_Query for a site I'm building which has me stumped. This works as expected: $package_args = array( 'post_type' ...
0
votes
1answer
94 views

Advanced AND tax_query in sidebar with 2 taxonomies

I have two taxonomy : brand and product. In single sidebar I am displaying the brand and product of the post in the sidebar but I would like to display all the other product of the current taxonomy ...
7
votes
1answer
1k views

Multiple relationship for multiple tax_query in WP_Query

I want to use the WP_Query class to filter some of my posts. The problem I facing now is handling the taxonomy query. Normally, the wp_query only handle one relationship for tax_query (either AND or ...
1
vote
1answer
369 views

When tax_query used, results disappear (0 =1 produced)

I'm trying to perform a dynamic query that uses a dynamically passed taxonomy and post_type, and displays results accordingly — A user makes a selection from 3 drop-downs on a form, each have a ...
0
votes
1answer
189 views

Set tax_query conditionally with new WP_Query

I have a page template with a custom query: <? $filter = explode(' ', $_GET['filter']); // "page/?filter=taxonomy+term" $paged = get_query_var('paged') ? get_query_var('paged') : 1; $query = new ...
0
votes
1answer
145 views

Cannot query custom post type taxonomy from theme options array

I am having no luck with querying a custom post type taxonomy from an array in theme options. My full code is below, would be grateful for some feedback to get it working correctly as I cannot get ...
-1
votes
1answer
68 views

why do drafts return as part of wp_query?

I have some code as plugin, which I call via AJAX from a page one the site. It gets two drop-down values and uses them in tax_query to fetch some posts. Question: why do drafts return amongst results ...
5
votes
1answer
3k views

Custom Taxonomy and Tax_Query

I've been having a lot of trouble getting a WP_Query running with a tax_query on my custom taxonomy. I'm 99.9% sure that my register_taxonomy is correct, as I'm able to tag posts with the right term, ...
0
votes
1answer
192 views

Tax_Query using WP_Query not working

I cannot get this query to work properly. It just renders one post even though I have three posts that are categories in the 'Firm News' and 'Test' categories. Can anyone see a problem with my code? ...
0
votes
2answers
147 views

How can i simulate “taxonomy__in” in query?

How can I have to set tax_query to get results like 'category__in' => array()? Specifically, I would like to show all the posts that have a term from the city taxonomy with one of these id's: $cities ...
2
votes
1answer
2k views

Nested meta_query with multiple relation keys

I am curious whether Wordpress is able to run nested meta_query, with each having different relation keys? As of Wordpress 3.0, tax_query is able to perform this function; I'm wondering whether this ...
1
vote
1answer
127 views

Query all posts in a given taxonomy

For sure it's very simple, but I can not figure out how to do this. I need to query all posts that has a specific taxonomy set. Like this: $query03 = array( 'numberposts' => 5, 'post_type' ...
0
votes
2answers
218 views

WP_Query parameter conflict

I am writing a query to retrieve instances of a custom post type I created called "Specialist". In the query I specify a name and more than one taxonomy. I want to retrieve just those specialist which ...
0
votes
2answers
169 views

tax_query not working in template

I have a custom post type called 'product' with a registered taxonomy 'product-type'. I want to display all post from a particular taxonomy from custom post type. In my case I want to display all the ...
1
vote
1answer
773 views

search query within custom taxonomy term, post title and meta field

I want to create a search that does: Search within my custom taxonomy - custom-tags search the post title search select meta field ?? dont know search with custom post type - easy part I looked ...
1
vote
2answers
222 views

How to add terms to my tax_query based off of the current post

I need the terms in my tax_query to be the ones from the current post. I am trying to this by using a variable. The value of the variable is given by using the get_terms() function. The problem is ...
0
votes
1answer
329 views

Show multiple tax_query from 2 or more post_type in a single code

i've been trying with no success to show 2 custom taxonomies from 2 post_type, here's my code: <?php /** * Display a list of the most recent news in 'Avisos' ...
1
vote
2answers
267 views

Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request

This is my first attempt at modifying the main query using the pre_get_posts action/filter This is the function currently hooked to it: function advanced_product_search_filter($query) { ...
0
votes
1answer
1k views

Conditional arguments for WP_Query and tax_query depending on if $somevar has a value

I've created a new query for a custom post type of 'courses'. Those results are then to be filtered using tax_query, querying 3 custom taxonomies matching 1 or several term ID's. These are passed from ...
1
vote
1answer
249 views

Using tax_query reverses my post_type argument in a custom WP_Query

I'm using a custom query to pull some posts from a custom post type. I'm having problems with it so I used print_r on my WP_Query object and I found something strange. my query has these arguments: ...
0
votes
1answer
1k views

How to do a particular wp_query taxonomy search

I have added a custom taxonomy called experience to the page post-type, and the taxonomy has terms "vfds" and "plcs" I am trying to create a search where a user can select one or more experience ...
2
votes
1answer
4k views

“tax_query” parameter not working with WP_Query

I have a custom post type called 'episode'. Attached to 'episode' I have a custom taxonomy called 'video_type' that contains two terms: "bonus-footage" and "episode"; "episode" contains two child ...
0
votes
1answer
399 views

How to limit posts to 1 from each term with tax_query?

Need 1 post from each. <?php global $post; // required $args = array ( 'tax_query' => array ( 'relation' => 'AND', array ( ...